aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <Krzysztof.Parzyszek@amd.com>2024-09-26 08:56:04 -0500
committerGitHub <noreply@github.com>2024-09-26 08:56:04 -0500
commit58e8683a31186a281d83499798aa5f867b4c5894 (patch)
tree35d26a061ef16311f1384a6c51fad047100bd404 /flang/lib/Frontend/CompilerInvocation.cpp
parentaf7aa223d27996b129a2d1a0a4540f270c9a1e03 (diff)
downloadllvm-58e8683a31186a281d83499798aa5f867b4c5894.zip
llvm-58e8683a31186a281d83499798aa5f867b4c5894.tar.gz
llvm-58e8683a31186a281d83499798aa5f867b4c5894.tar.bz2
[flang][Frontend] Move LangOptions from Frontend to Common (#110012)
The information in LangOptions is not tied to any frontend code, and could be used by any other component.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 90c3275..52ca9f6 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -1110,17 +1110,17 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
static bool parseFloatingPointArgs(CompilerInvocation &invoc,
llvm::opt::ArgList &args,
clang::DiagnosticsEngine &diags) {
- LangOptions &opts = invoc.getLangOpts();
+ Fortran::common::LangOptions &opts = invoc.getLangOpts();
if (const llvm::opt::Arg *a =
args.getLastArg(clang::driver::options::OPT_ffp_contract)) {
const llvm::StringRef val = a->getValue();
- enum LangOptions::FPModeKind fpContractMode;
+ enum Fortran::common::LangOptions::FPModeKind fpContractMode;
if (val == "off")
- fpContractMode = LangOptions::FPM_Off;
+ fpContractMode = Fortran::common::LangOptions::FPM_Off;
else if (val == "fast")
- fpContractMode = LangOptions::FPM_Fast;
+ fpContractMode = Fortran::common::LangOptions::FPM_Fast;
else {
diags.Report(clang::diag::err_drv_unsupported_option_argument)
<< a->getSpelling() << val;
@@ -1161,7 +1161,7 @@ static bool parseFloatingPointArgs(CompilerInvocation &invoc,
opts.ReciprocalMath = true;
opts.ApproxFunc = true;
opts.NoSignedZeros = true;
- opts.setFPContractMode(LangOptions::FPM_Fast);
+ opts.setFPContractMode(Fortran::common::LangOptions::FPM_Fast);
}
return true;
@@ -1194,7 +1194,7 @@ static bool parseVScaleArgs(CompilerInvocation &invoc, llvm::opt::ArgList &args,
return false;
}
- LangOptions &opts = invoc.getLangOpts();
+ Fortran::common::LangOptions &opts = invoc.getLangOpts();
if (vscaleMin) {
llvm::StringRef argValue = llvm::StringRef(vscaleMin->getValue());
unsigned vscaleMinVal;
@@ -1556,14 +1556,14 @@ void CompilerInvocation::setLoweringOptions() {
loweringOpts.setOptimizeTranspose(codegenOpts.OptimizationLevel > 0);
loweringOpts.setUnderscoring(codegenOpts.Underscoring);
- const LangOptions &langOptions = getLangOpts();
+ const Fortran::common::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)
+ Fortran::common::LangOptions::FPM_Fast)
.setNoHonorInfs(langOptions.NoHonorInfs)
.setNoHonorNaNs(langOptions.NoHonorNaNs)
.setApproxFunc(langOptions.ApproxFunc)