diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-05-02 14:55:48 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-05-02 14:55:48 +0000 |
commit | 769aa2d46fa5dc0bee5285c95a80ad8749cb79cf (patch) | |
tree | 515a65d780b421ee5e78c60103c9e79bb7ba8caa /lib/Driver/Tools.cpp | |
parent | d6268ffe94e5159ef41c61fe7f750c22546d3ef3 (diff) |
Driver: Turn the default value for -fmath-errno into a proper target hook and disable it by default on more platforms.
For now -fno-math-errno is the default on BSD-derived platforms (Darwin,
DragonFlyBSD, FreeBSD, NetBSD, OpenBSD). If the default is not right for
your platform, please yell. I only verified the result with the default
compilers on Darwin and FreeBSD.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 2cf0c6747c..6b3effb4d0 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1617,9 +1617,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, A->getOption().getID() != options::OPT_fhonor_nans) CmdArgs.push_back("-menable-no-nans"); - // -fno-math-errno is default on Darwin. Other platforms, -fmath-errno is the - // default. - bool MathErrno = !getToolChain().getTriple().isOSDarwin(); + // -fmath-errno is the default on some platforms, e.g. BSD-derived OSes. + bool MathErrno = getToolChain().IsMathErrnoDefault(); if (Arg *A = Args.getLastArg(options::OPT_ffast_math, options::OPT_fmath_errno, options::OPT_fno_math_errno)) |