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.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 30e53ce..e7730d5 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -1344,11 +1344,12 @@ void CompilerInvocation::setFortranOpts() {
fortranOptions.features.WarnOnAllUsage();
}
-void CompilerInvocation::setSemanticsOpts(
+std::unique_ptr<Fortran::semantics::SemanticsContext>
+CompilerInvocation::getSemanticsCtx(
Fortran::parser::AllCookedSources &allCookedSources) {
auto &fortranOptions = getFortranOpts();
- semanticsContext = std::make_unique<semantics::SemanticsContext>(
+ auto semanticsContext = std::make_unique<semantics::SemanticsContext>(
getDefaultKinds(), fortranOptions.features, allCookedSources);
semanticsContext->set_moduleDirectory(getModuleDir())
@@ -1372,6 +1373,8 @@ void CompilerInvocation::setSemanticsOpts(
if (targetTriple.isPPC())
semanticsContext->targetCharacteristics().set_isPPC(true);
+
+ return semanticsContext;
}
/// Set \p loweringOptions controlling lowering behavior based