diff options
author | Lang Hames <lhames@gmail.com> | 2012-11-15 07:51:26 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2012-11-15 07:51:26 +0000 |
commit | 65992f454c994d126e57704e74ffb1b7a01914d9 (patch) | |
tree | 0f9cd6f59e1243a2d51aa0939f100a854e94a51a /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 22a6503df6b0e7567b5c03249790e5d4b31bc8f4 (diff) | |
download | bcm5719-llvm-65992f454c994d126e57704e74ffb1b7a01914d9.tar.gz bcm5719-llvm-65992f454c994d126e57704e74ffb1b7a01914d9.zip |
Make -ffp-contract a codegen option, rather than a laguage option. This makes
more sense anyway - it determines how expressions are codegen'd. It also ensures
that -ffp-contract=fast has the intended effect when compiling LLVM IR.
llvm-svn: 168027
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 1da462abba7..df4c88389c3 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/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; |