summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorSjoerd Meijer <sjoerd.meijer@arm.com>2016-10-13 13:22:01 +0000
committerSjoerd Meijer <sjoerd.meijer@arm.com>2016-10-13 13:22:01 +0000
commitee3c7e0d429c6c1b7c6b6c0763ee1c820fe5a565 (patch)
tree6cd247c35e8a599b86eb0050538251f80d7bc21e /clang/lib
parentbb1db210a8c46708b77704edf26d9d3a7b77f453 (diff)
downloadbcm5719-llvm-ee3c7e0d429c6c1b7c6b6c0763ee1c820fe5a565.tar.gz
bcm5719-llvm-ee3c7e0d429c6c1b7c6b6c0763ee1c820fe5a565.zip
Guard flag –fdenormal-fp-math with –fno-fast-math.
This allows disabling the FP options with just one flag (-fno-fast-math). Differential Revision: https://reviews.llvm.org/D25479 llvm-svn: 284121
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Driver/Tools.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 6c07b9b5de2..eb27cb486bd 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -4391,11 +4391,18 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (ReciprocalMath)
CmdArgs.push_back("-freciprocal-math");
- if (!TrappingMath)
+ if (!TrappingMath)
CmdArgs.push_back("-fno-trapping-math");
- if (Args.hasArg(options::OPT_fdenormal_fp_math_EQ))
- Args.AddLastArg(CmdArgs, options::OPT_fdenormal_fp_math_EQ);
+
+ if (Arg *A = Args.getLastArg(options::OPT_ffast_math, FastMathAliasOption,
+ options::OPT_fno_fast_math,
+ options::OPT_funsafe_math_optimizations,
+ options::OPT_fno_unsafe_math_optimizations,
+ options::OPT_fdenormal_fp_math_EQ))
+ if (A->getOption().getID() != options::OPT_fno_fast_math &&
+ A->getOption().getID() != options::OPT_fno_unsafe_math_optimizations)
+ Args.AddLastArg(CmdArgs, options::OPT_fdenormal_fp_math_EQ);
// Validate and pass through -fp-contract option.
if (Arg *A = Args.getLastArg(options::OPT_ffast_math, FastMathAliasOption,
OpenPOWER on IntegriCloud