aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAndrzej Warzynski <andrzej.warzynski@arm.com>2022-04-07 09:47:23 +0000
committerAndrzej Warzynski <andrzej.warzynski@arm.com>2022-04-14 09:40:31 +0000
commit6c93e1d329e6c6ef828ec63c66f4cb39ee9cb9ce (patch)
tree9d696f12500ac390d43e7c2628ae1f2833a9e7d8 /flang/lib/Frontend/CompilerInvocation.cpp
parent04a3f3f167dbf90fb11524c00af5313c2b135ad3 (diff)
downloadllvm-6c93e1d329e6c6ef828ec63c66f4cb39ee9cb9ce.zip
llvm-6c93e1d329e6c6ef828ec63c66f4cb39ee9cb9ce.tar.gz
llvm-6c93e1d329e6c6ef828ec63c66f4cb39ee9cb9ce.tar.bz2
[flang][driver] Add support for `-mmlir`
The semantics of `-mmlir` are identical to `-mllvm`. The only notable difference is that `-mmlir` options should be forwarded to MLIR rather than LLVM. Note that MLIR llvm::cl options are lazily constructed on demand (see the definition of options in PassManagerOptions.cpp). This means that: * MLIR global options are only visible when explicitly initialised and displayed only when using `-mmlir --help`, * Flang and LLVM global options are always visible and displayed when using either `-mllvm -help` or `-mmlir --help`. In other words, `-mmlir --help` is a superset of `-mllvm --help`. This is not ideal, but we'd need to refactor all option definitions in Flang and LLVM to improve this. I suggesting leaving this for later. Differential Revision: https://reviews.llvm.org/D123297
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 ea5accd7..0f0db57 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -597,6 +597,9 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &res,
res.frontendOpts_.llvmArgs =
args.getAllArgValues(clang::driver::options::OPT_mllvm);
+ res.frontendOpts_.mlirArgs =
+ args.getAllArgValues(clang::driver::options::OPT_mmlir);
+
return success;
}