diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/BackendUtil.cpp | 8 | ||||
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 24 |
3 files changed, 17 insertions, 17 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 62f87c983b..c698102278 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -381,14 +381,14 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) { } // Set FP fusion mode. - switch (LangOpts.getFPContractMode()) { - case LangOptions::FPC_Off: + switch (CodeGenOpts.getFPContractMode()) { + case CodeGenOptions::FPC_Off: Options.AllowFPOpFusion = llvm::FPOpFusion::Strict; break; - case LangOptions::FPC_On: + case CodeGenOptions::FPC_On: Options.AllowFPOpFusion = llvm::FPOpFusion::Standard; break; - case LangOptions::FPC_Fast: + case CodeGenOptions::FPC_Fast: Options.AllowFPOpFusion = llvm::FPOpFusion::Fast; break; } diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index b429b1d6e4..ed8b9c69ec 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -2217,7 +2217,7 @@ static Value* tryEmitFMulAdd(const BinOpInfo &op, // Check whether -ffp-contract=on. (If -ffp-contract=off/fast, fusing is // either disabled, or handled entirely by the LLVM backend). - if (CGF.getLangOpts().getFPContractMode() != LangOptions::FPC_On) + if (CGF.CGM.getCodeGenOpts().getFPContractMode() != CodeGenOptions::FPC_On) return 0; // We have a potentially fusable op. Look for a mul on one of the operands. diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 1da462abba..df4c88389c 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -446,6 +446,18 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, } } + if (Arg *A = Args.getLastArg(OPT_ffp_contract)) { + StringRef Val = A->getValue(); + if (Val == "fast") + Opts.setFPContractMode(CodeGenOptions::FPC_Fast); + else if (Val == "on") + Opts.setFPContractMode(CodeGenOptions::FPC_On); + else if (Val == "off") + Opts.setFPContractMode(CodeGenOptions::FPC_Off); + else + Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Val; + } + return Success; } @@ -1140,18 +1152,6 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, Diags.Report(diag::err_drv_invalid_value) << Args.getLastArg(OPT_fvisibility)->getAsString(Args) << Vis; - if (Arg *A = Args.getLastArg(OPT_ffp_contract)) { - StringRef Val = A->getValue(); - if (Val == "fast") - Opts.setFPContractMode(LangOptions::FPC_Fast); - else if (Val == "on") - Opts.setFPContractMode(LangOptions::FPC_On); - else if (Val == "off") - Opts.setFPContractMode(LangOptions::FPC_Off); - else - Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Val; - } - if (Args.hasArg(OPT_fvisibility_inlines_hidden)) Opts.InlineVisibilityHidden = 1; |