aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorStuart Ellis <stuart.ellis@arm.com>2021-06-07 15:40:26 +0100
committerAndrzej Warzynski <andrzej.warzynski@arm.com>2021-06-07 15:40:26 +0100
commite1da3297d253b33be1ff941cf9ed9091dd332ea5 (patch)
treee1564805788885b5a6e4c32d72ea34ee941ba6d9 /flang/lib/Frontend/CompilerInvocation.cpp
parentae3f6de3a856006601cbca81ebf9780a2534bdcc (diff)
downloadllvm-e1da3297d253b33be1ff941cf9ed9091dd332ea5.zip
llvm-e1da3297d253b33be1ff941cf9ed9091dd332ea5.tar.gz
llvm-e1da3297d253b33be1ff941cf9ed9091dd332ea5.tar.bz2
[flang][driver] Add support for the "-init-only" option
Adding the `-init-only` option and corresponding frontend action to generate a diagnostic. `-init-only` vs `-test-io`: `-init-only` ignores the input (it never calls the prescanner) `-test-io` is similar to `-init-only`, but does read and print the input without calling the prescanner. This patch also adds a Driver test to check this action. Reviewed By: awarzynski, AMDChirag Differential Revision: https://reviews.llvm.org/D102849
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 6d9a3a7..5098da4 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -162,9 +162,12 @@ static bool ParseFrontendArgs(FrontendOptions &opts, llvm::opt::ArgList &args,
case clang::driver::options::OPT_fget_definition:
opts.programAction_ = GetDefinition;
break;
+ case clang::driver::options::OPT_init_only:
+ opts.programAction_ = InitOnly;
+ break;
// TODO:
- // case calng::driver::options::OPT_emit_llvm:
+ // case clang::driver::options::OPT_emit_llvm:
// case clang::driver::options::OPT_emit_llvm_only:
// case clang::driver::options::OPT_emit_codegen_only:
// case clang::driver::options::OPT_emit_module: