diff options
author | Bob Wilson <bob.wilson@apple.com> | 2012-07-19 03:52:53 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2012-07-19 03:52:53 +0000 |
commit | 6a039161d7b61ae69380e049f314eabb702372b9 (patch) | |
tree | 810fd4fc5b9a991a2116a0b35b51dbf02244729f /clang/lib/Driver/Tools.cpp | |
parent | 24a1047c8cda684c12cf473fa8adb21aca567f4e (diff) | |
download | bcm5719-llvm-6a039161d7b61ae69380e049f314eabb702372b9.tar.gz bcm5719-llvm-6a039161d7b61ae69380e049f314eabb702372b9.zip |
Define __FINITE_MATH_ONLY__ based on -ffast-math and -ffinite-math-only.
This macro was being unconditionally set to zero, preceded by a FIXME comment.
This fixes <rdar://problem/11845441>. Patch by Michael Gottesman!
llvm-svn: 160491
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 59196b20e28..e07068aea14 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -1823,12 +1823,15 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } } - // We separately look for the '-ffast-math' flag, and if we find it, tell the - // frontend to provide the appropriate preprocessor macros. This is distinct - // from enabling any optimizations as it induces a language change which must - // survive serialization and deserialization, etc. + // We separately look for the '-ffast-math' and '-ffinite-math-only' flags, + // and if we find them, tell the frontend to provide the appropriate + // preprocessor macros. This is distinct from enabling any optimizations as + // these options induce language changes which must survive serialization + // and deserialization, etc. if (Args.hasArg(options::OPT_ffast_math)) CmdArgs.push_back("-ffast-math"); + if (Args.hasArg(options::OPT_ffinite_math_only)) + CmdArgs.push_back("-ffinite-math-only"); // Decide whether to use verbose asm. Verbose assembly is the default on // toolchains which have the integrated assembler on by default. |