From dd56939a4b04072a449a05701373e95d00cc494f Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Wed, 6 Apr 2022 11:59:28 +0000 Subject: [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 --- flang/lib/Frontend/CompilerInvocation.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'flang/lib/Frontend/CompilerInvocation.cpp') 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; -- cgit v1.1