aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAndrzej Warzynski <andrzej.warzynski@arm.com>2022-04-06 11:59:28 +0000
committerAndrzej Warzynski <andrzej.warzynski@arm.com>2022-04-13 10:19:56 +0000
commitdd56939a4b04072a449a05701373e95d00cc494f (patch)
treeed3e97c1cdf1e937e5a07eccaf1ac6bdcba9ab6d /flang/lib/Frontend/CompilerInvocation.cpp
parent9d2350fd19f5a36fabd9b2c225af582b131ffce6 (diff)
downloadllvm-dd56939a4b04072a449a05701373e95d00cc494f.zip
llvm-dd56939a4b04072a449a05701373e95d00cc494f.tar.gz
llvm-dd56939a4b04072a449a05701373e95d00cc494f.tar.bz2
[flang][driver] Add support for generating LLVM bytecode files
Support for generating LLVM BC files is added in Flang's compiler and frontend drivers. This requires the `BitcodeWriterPass` pass to be run on the input LLVM IR module and is implemented as a dedicated frontend aciton. The new functionality as seen by the user (compiler driver): ``` flang-new -c -emit-llvm file.90 ``` or (frontend driver): ``` flang-new -fc1 -emit-llvm-bc file.f90 ``` The new behaviour is consistent with `clang` and `clang -cc1`. Differential Revision: https://reviews.llvm.org/D123211
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 d1f427a..ea5accd7 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -148,6 +148,9 @@ static bool ParseFrontendArgs(FrontendOptions &opts, llvm::opt::ArgList &args,
case clang::driver::options::OPT_emit_llvm:
opts.programAction = EmitLLVM;
break;
+ case clang::driver::options::OPT_emit_llvm_bc:
+ opts.programAction = EmitLLVMBitcode;
+ break;
case clang::driver::options::OPT_emit_obj:
opts.programAction = EmitObj;
break;