aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorTom Eccles <tom.eccles@arm.com>2023-05-22 12:55:10 +0000
committerTom Eccles <tom.eccles@arm.com>2023-06-01 19:29:16 +0000
commit39ecf9d8a1533a434bb9544a1bc275c4d02e2efb (patch)
tree444564aeb8bf95809c66b98ee08bb2535c7a423a /flang/lib/Frontend/CompilerInvocation.cpp
parent01ef213b855da7a0e0ac7206d27c71f2f5345ca7 (diff)
downloadllvm-39ecf9d8a1533a434bb9544a1bc275c4d02e2efb.zip
llvm-39ecf9d8a1533a434bb9544a1bc275c4d02e2efb.tar.gz
llvm-39ecf9d8a1533a434bb9544a1bc275c4d02e2efb.tar.bz2
[flang][hlfir] Separate -emit-fir and -emit-hlfir for flang-new
In review for https://reviews.llvm.org/D146278, @vzakhari asked to separate -emit-fir and -emit-hlfir. This will allow FIR to be easily outputted after the HLFIR passes have been run. The new semantics are as follows: | Action | -flang-experimental-hlfir? | Result | | =========== | ========================== | =============================== | | -emit-hlfir | N | Outputs HLFIR | | -emit-hlfir | Y | Outputs HLFIR | | -emit-fir | N | Outputs FIR, using old lowering | | -emit-fir | Y | Outputs FIR, lowering via HLFIR | A patch for bbc will follow. Differential Revision: https://reviews.llvm.org/D151088
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 98a8714..0297317 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -306,8 +306,11 @@ static bool parseFrontendArgs(FrontendOptions &opts, llvm::opt::ArgList &args,
case clang::driver::options::OPT_fsyntax_only:
opts.programAction = ParseSyntaxOnly;
break;
- case clang::driver::options::OPT_emit_mlir:
- opts.programAction = EmitMLIR;
+ case clang::driver::options::OPT_emit_fir:
+ opts.programAction = EmitFIR;
+ break;
+ case clang::driver::options::OPT_emit_hlfir:
+ opts.programAction = EmitHLFIR;
break;
case clang::driver::options::OPT_emit_llvm:
opts.programAction = EmitLLVM;
@@ -911,7 +914,8 @@ bool CompilerInvocation::createFromArgs(
}
// -flang-experimental-hlfir
- if (args.hasArg(clang::driver::options::OPT_flang_experimental_hlfir)) {
+ if (args.hasArg(clang::driver::options::OPT_flang_experimental_hlfir) ||
+ args.hasArg(clang::driver::options::OPT_emit_hlfir)) {
res.loweringOpts.setLowerToHighLevelFIR(true);
}