aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAndrzej Warzynski <andrzej.warzynski@arm.com>2021-06-04 13:58:03 +0100
committerAndrzej Warzynski <andrzej.warzynski@arm.com>2021-06-04 13:58:04 +0100
commit20bd2142d46536f4ffd61f28a029d6bda68f1a7f (patch)
treeea64320807c58b9b7d507eefa2e9ca46e49f495d /flang/lib/Frontend/CompilerInvocation.cpp
parent35ef4c940bea1e2b803f17f13a625b2126c62b82 (diff)
downloadllvm-20bd2142d46536f4ffd61f28a029d6bda68f1a7f.zip
llvm-20bd2142d46536f4ffd61f28a029d6bda68f1a7f.tar.gz
llvm-20bd2142d46536f4ffd61f28a029d6bda68f1a7f.tar.bz2
[flang][driver] Add support for `-module-suffix`
This option is supported in `f18`, but not yet available in `flang-new`. It is required in order to call `flang-new` from the `flang` bash script. Differential Revision: https://reviews.llvm.org/D103613
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 1f61e0e..1d18dda 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -392,6 +392,12 @@ static bool parseSemaArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
res.SetDebugModuleDir(true);
}
+ // -module-suffix
+ if (const auto *moduleSuffix =
+ args.getLastArg(clang::driver::options::OPT_module_suffix)) {
+ res.SetModuleFileSuffix(moduleSuffix->getValue());
+ }
+
return diags.getNumErrors() == numErrorsBefore;
}
@@ -639,5 +645,6 @@ void CompilerInvocation::setSemanticsOpts(
semanticsContext_->set_moduleDirectory(moduleDir())
.set_searchDirectories(fortranOptions.searchDirectories)
.set_warnOnNonstandardUsage(enableConformanceChecks())
- .set_warningsAreErrors(warnAsErr());
+ .set_warningsAreErrors(warnAsErr())
+ .set_moduleFileSuffix(moduleFileSuffix());
}