[flang][driver] Add support for generating LLVM bytecode files
authorAndrzej Warzynski <andrzej.warzynski@arm.com>
Wed, 6 Apr 2022 11:59:28 +0000 (11:59 +0000)
committerAndrzej Warzynski <andrzej.warzynski@arm.com>
Wed, 13 Apr 2022 10:19:56 +0000 (10:19 +0000)
commitdd56939a4b04072a449a05701373e95d00cc494f
treeed3e97c1cdf1e937e5a07eccaf1ac6bdcba9ab6d
parent9d2350fd19f5a36fabd9b2c225af582b131ffce6
[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
clang/include/clang/Driver/Options.td
flang/include/flang/Frontend/FrontendActions.h
flang/include/flang/Frontend/FrontendOptions.h
flang/lib/Frontend/CMakeLists.txt
flang/lib/Frontend/CompilerInvocation.cpp
flang/lib/Frontend/FrontendActions.cpp
flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
flang/test/CMakeLists.txt
flang/test/Driver/driver-help.f90
flang/test/Driver/emit-llvm-bc.f90 [new file with mode: 0644]