aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flang/include/flang/Common/LangOptions.def (renamed from flang/include/flang/Frontend/LangOptions.def)0
-rw-r--r--flang/include/flang/Common/LangOptions.h (renamed from flang/include/flang/Frontend/LangOptions.h)20
-rw-r--r--flang/include/flang/Frontend/CompilerInvocation.h8
-rw-r--r--flang/include/flang/Tools/CrossToolHelpers.h4
-rw-r--r--flang/lib/Common/CMakeLists.txt1
-rw-r--r--flang/lib/Common/LangOptions.cpp (renamed from flang/lib/Frontend/LangOptions.cpp)8
-rw-r--r--flang/lib/Frontend/CMakeLists.txt1
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp16
8 files changed, 29 insertions, 29 deletions
diff --git a/flang/include/flang/Frontend/LangOptions.def b/flang/include/flang/Common/LangOptions.def
index d3e1e97..d3e1e97 100644
--- a/flang/include/flang/Frontend/LangOptions.def
+++ b/flang/include/flang/Common/LangOptions.def
diff --git a/flang/include/flang/Frontend/LangOptions.h b/flang/include/flang/Common/LangOptions.h
index 57d86d4..52a4504 100644
--- a/flang/include/flang/Frontend/LangOptions.h
+++ b/flang/include/flang/Common/LangOptions.h
@@ -12,15 +12,15 @@
//
//===----------------------------------------------------------------------===//
-#ifndef FORTRAN_FRONTEND_LANGOPTIONS_H
-#define FORTRAN_FRONTEND_LANGOPTIONS_H
+#ifndef FORTRAN_COMMON_LANGOPTIONS_H
+#define FORTRAN_COMMON_LANGOPTIONS_H
#include <string>
#include <vector>
#include "llvm/TargetParser/Triple.h"
-namespace Fortran::frontend {
+namespace Fortran::common {
/// Bitfields of LangOptions, split out from LangOptions to ensure
/// that this large collection of bitfields is a trivial class type.
@@ -37,12 +37,12 @@ public:
#define LANGOPT(Name, Bits, Default) unsigned Name : Bits;
#define ENUM_LANGOPT(Name, Type, Bits, Default)
-#include "flang/Frontend/LangOptions.def"
+#include "flang/Common/LangOptions.def"
protected:
#define LANGOPT(Name, Bits, Default)
#define ENUM_LANGOPT(Name, Type, Bits, Default) unsigned Name : Bits;
-#include "flang/Frontend/LangOptions.def"
+#include "flang/Common/LangOptions.def"
};
/// Tracks various options which control the dialect of Fortran that is
@@ -52,10 +52,10 @@ class LangOptions : public LangOptionsBase {
public:
// Define accessors/mutators for code generation options of enumeration type.
#define LANGOPT(Name, Bits, Default)
-#define ENUM_LANGOPT(Name, Type, Bits, Default) \
- Type get##Name() const { return static_cast<Type>(Name); } \
+#define ENUM_LANGOPT(Name, Type, Bits, Default) \
+ Type get##Name() const { return static_cast<Type>(Name); } \
void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
-#include "flang/Frontend/LangOptions.def"
+#include "flang/Common/LangOptions.def"
/// Name of the IR file that contains the result of the OpenMP target
/// host code generation.
@@ -67,6 +67,6 @@ public:
LangOptions();
};
-} // end namespace Fortran::frontend
+} // end namespace Fortran::common
-#endif // FORTRAN_FRONTEND_LANGOPTIONS_H
+#endif // FORTRAN_COMMON_LANGOPTIONS_H
diff --git a/flang/include/flang/Frontend/CompilerInvocation.h b/flang/include/flang/Frontend/CompilerInvocation.h
index d1646f5..50d908d 100644
--- a/flang/include/flang/Frontend/CompilerInvocation.h
+++ b/flang/include/flang/Frontend/CompilerInvocation.h
@@ -13,9 +13,9 @@
#ifndef FORTRAN_FRONTEND_COMPILERINVOCATION_H
#define FORTRAN_FRONTEND_COMPILERINVOCATION_H
+#include "flang/Common/LangOptions.h"
#include "flang/Frontend/CodeGenOptions.h"
#include "flang/Frontend/FrontendOptions.h"
-#include "flang/Frontend/LangOptions.h"
#include "flang/Frontend/PreprocessorOptions.h"
#include "flang/Frontend/TargetOptions.h"
#include "flang/Lower/LoweringOptions.h"
@@ -84,7 +84,7 @@ class CompilerInvocation : public CompilerInvocationBase {
Fortran::frontend::CodeGenOptions codeGenOpts;
/// Options controlling language dialect.
- Fortran::frontend::LangOptions langOpts;
+ Fortran::common::LangOptions langOpts;
// The original invocation of the compiler driver.
// This string will be set as the return value from the COMPILER_OPTIONS
@@ -158,8 +158,8 @@ public:
CodeGenOptions &getCodeGenOpts() { return codeGenOpts; }
const CodeGenOptions &getCodeGenOpts() const { return codeGenOpts; }
- LangOptions &getLangOpts() { return langOpts; }
- const LangOptions &getLangOpts() const { return langOpts; }
+ Fortran::common::LangOptions &getLangOpts() { return langOpts; }
+ const Fortran::common::LangOptions &getLangOpts() const { return langOpts; }
Fortran::lower::LoweringOptions &getLoweringOpts() { return loweringOpts; }
const Fortran::lower::LoweringOptions &getLoweringOpts() const {
diff --git a/flang/include/flang/Tools/CrossToolHelpers.h b/flang/include/flang/Tools/CrossToolHelpers.h
index 75fd783..3e703de 100644
--- a/flang/include/flang/Tools/CrossToolHelpers.h
+++ b/flang/include/flang/Tools/CrossToolHelpers.h
@@ -13,9 +13,9 @@
#ifndef FORTRAN_TOOLS_CROSS_TOOL_HELPERS_H
#define FORTRAN_TOOLS_CROSS_TOOL_HELPERS_H
+#include "flang/Common/LangOptions.h"
#include "flang/Common/MathOptionsBase.h"
#include "flang/Frontend/CodeGenOptions.h"
-#include "flang/Frontend/LangOptions.h"
#include <cstdint>
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
@@ -145,7 +145,7 @@ struct OffloadModuleOpts {
OMPTargetTriples(OMPTargetTriples.begin(), OMPTargetTriples.end()),
NoGPULib(NoGPULib) {}
- OffloadModuleOpts(Fortran::frontend::LangOptions &Opts)
+ OffloadModuleOpts(Fortran::common::LangOptions &Opts)
: OpenMPTargetDebug(Opts.OpenMPTargetDebug),
OpenMPTeamSubscription(Opts.OpenMPTeamSubscription),
OpenMPThreadSubscription(Opts.OpenMPThreadSubscription),
diff --git a/flang/lib/Common/CMakeLists.txt b/flang/lib/Common/CMakeLists.txt
index 6579e9c..be72391 100644
--- a/flang/lib/Common/CMakeLists.txt
+++ b/flang/lib/Common/CMakeLists.txt
@@ -39,6 +39,7 @@ add_flang_library(FortranCommon
Fortran-features.cpp
default-kinds.cpp
idioms.cpp
+ LangOptions.cpp
Version.cpp
${version_inc}
diff --git a/flang/lib/Frontend/LangOptions.cpp b/flang/lib/Common/LangOptions.cpp
index a08cb36..415c715 100644
--- a/flang/lib/Frontend/LangOptions.cpp
+++ b/flang/lib/Common/LangOptions.cpp
@@ -10,15 +10,15 @@
//
//===----------------------------------------------------------------------===//
-#include "flang/Frontend/LangOptions.h"
+#include "flang/Common/LangOptions.h"
#include <string.h>
-namespace Fortran::frontend {
+namespace Fortran::common {
LangOptions::LangOptions() {
#define LANGOPT(Name, Bits, Default) Name = Default;
#define ENUM_LANGOPT(Name, Type, Bits, Default) set##Name(Default);
-#include "flang/Frontend/LangOptions.def"
+#include "flang/Common/LangOptions.def"
}
-} // end namespace Fortran::frontend
+} // end namespace Fortran::common
diff --git a/flang/lib/Frontend/CMakeLists.txt b/flang/lib/Frontend/CMakeLists.txt
index ebfdb14..e954800 100644
--- a/flang/lib/Frontend/CMakeLists.txt
+++ b/flang/lib/Frontend/CMakeLists.txt
@@ -8,7 +8,6 @@ add_flang_library(flangFrontend
FrontendAction.cpp
FrontendActions.cpp
FrontendOptions.cpp
- LangOptions.cpp
TextDiagnosticPrinter.cpp
TextDiagnosticBuffer.cpp
TextDiagnostic.cpp
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)