Fix for r280064 that added options for fp denormals and exceptions.
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Fri, 23 Sep 2016 15:21:33 +0000 (15:21 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Fri, 23 Sep 2016 15:21:33 +0000 (15:21 +0000)
These options were forgotten to be copied in setCommandLineOpts.

llvm-svn: 282255

clang/lib/CodeGen/BackendUtil.cpp

index 541e676..2eab755 100644 (file)
@@ -537,6 +537,12 @@ void EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
       .Case("posix", llvm::ThreadModel::POSIX)
       .Case("single", llvm::ThreadModel::Single);
 
+  Options.FPDenormalType =
+    llvm::StringSwitch<llvm::FPDenormal::DenormalType>(CodeGenOpts.FPDenormalMode)
+      .Case("ieee", llvm::FPDenormal::IEEE)
+      .Case("preserve-sign", llvm::FPDenormal::PreserveSign)
+      .Case("positive-zero", llvm::FPDenormal::PositiveZero);
+
   // Set float ABI type.
   assert((CodeGenOpts.FloatABI == "soft" || CodeGenOpts.FloatABI == "softfp" ||
           CodeGenOpts.FloatABI == "hard" || CodeGenOpts.FloatABI.empty()) &&
@@ -579,6 +585,7 @@ void EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
   Options.LessPreciseFPMADOption = CodeGenOpts.LessPreciseFPMAD;
   Options.NoInfsFPMath = CodeGenOpts.NoInfsFPMath;
   Options.NoNaNsFPMath = CodeGenOpts.NoNaNsFPMath;
+  Options.NoTrappingFPMath = CodeGenOpts.NoTrappingMath;
   Options.NoZerosInBSS = CodeGenOpts.NoZeroInitializedInBSS;
   Options.UnsafeFPMath = CodeGenOpts.UnsafeFPMath;
   Options.StackAlignmentOverride = CodeGenOpts.StackAlignment;