aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorSergio Afonso <safonsof@amd.com>2023-03-14 17:40:04 +0000
committerSergio Afonso <safonsof@amd.com>2023-03-24 17:13:40 +0000
commit33be83415c9b5e9a874fcbddee8e64ecf464c203 (patch)
treea29e56032d7335964e0fca03a61acb5b4c42e8db /flang/lib/Frontend/CompilerInvocation.cpp
parente74834f9bb6bb608e00e2cd230cb3b63df0803b9 (diff)
downloadllvm-33be83415c9b5e9a874fcbddee8e64ecf464c203.zip
llvm-33be83415c9b5e9a874fcbddee8e64ecf464c203.tar.gz
llvm-33be83415c9b5e9a874fcbddee8e64ecf464c203.tar.bz2
[flang][driver][openmp] Write MLIR for -save-temps
This patch adds support for producing MLIR files when using -save-temps on flang. One MLIR file will be produced before lowering and optimization passes, containing the operations produced by the PFT-to-MLIR lowering bridge, and another at the end of the process, just before LLVM IR generation. This is accomplished by forwarding the -save-temps flag from the driver to the frontend, and modifying it to output MLIR files accordingly. Differential Revision: https://reviews.llvm.org/D146075
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index a4183a5..49dfeed 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -150,6 +150,9 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts,
opts.PrepareForThinLTO = true;
}
+ if (auto *a = args.getLastArg(clang::driver::options::OPT_save_temps_EQ))
+ opts.SaveTempsDir = a->getValue();
+
// -mrelocation-model option.
if (const llvm::opt::Arg *a =
args.getLastArg(clang::driver::options::OPT_mrelocation_model)) {