aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index bb87ea2..f218014 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -944,8 +944,18 @@ void CompilerInvocation::setSemanticsOpts(
/// Set \p loweringOptions controlling lowering behavior based
/// on the \p optimizationLevel.
void CompilerInvocation::setLoweringOptions() {
- const auto &codegenOpts = getCodeGenOpts();
+ const CodeGenOptions &codegenOpts = getCodeGenOpts();
// Lower TRANSPOSE as a runtime call under -O0.
loweringOpts.setOptimizeTranspose(codegenOpts.OptimizationLevel > 0);
+
+ const LangOptions &langOptions = getLangOpts();
+ Fortran::common::MathOptionsBase &mathOpts = loweringOpts.getMathOptions();
+ // TODO: when LangOptions are finalized, we can represent
+ // the math related options using Fortran::commmon::MathOptionsBase,
+ // so that we can just copy it into LoweringOptions.
+ mathOpts
+ .setFPContractEnabled(langOptions.getFPContractMode() ==
+ LangOptions::FPM_Fast)
+ .setNoHonorInfs(langOptions.NoHonorInfs);
}