[flang][hlfir] Separate -emit-fir and -emit-hlfir for flang-new
authorTom Eccles <tom.eccles@arm.com>
Mon, 22 May 2023 12:55:10 +0000 (12:55 +0000)
committerTom Eccles <tom.eccles@arm.com>
Thu, 1 Jun 2023 19:29:16 +0000 (19:29 +0000)
commit39ecf9d8a1533a434bb9544a1bc275c4d02e2efb
tree444564aeb8bf95809c66b98ee08bb2535c7a423a
parent01ef213b855da7a0e0ac7206d27c71f2f5345ca7
[flang][hlfir] Separate -emit-fir and -emit-hlfir for flang-new

In review for https://reviews.llvm.org/D146278, @vzakhari asked to
separate -emit-fir and -emit-hlfir. This will allow FIR to be easily
outputted after the HLFIR passes have been run.

The new semantics are as follows:

| Action      | -flang-experimental-hlfir? | Result |
| =========== | ========================== | =============================== |
| -emit-hlfir | N                          | Outputs HLFIR                   |
| -emit-hlfir | Y                          | Outputs HLFIR                   |
| -emit-fir   | N                          | Outputs FIR, using old lowering |
| -emit-fir   | Y                          | Outputs FIR, lowering via HLFIR |

A patch for bbc will follow.

Differential Revision: https://reviews.llvm.org/D151088
clang/include/clang/Driver/Options.td
flang/include/flang/Frontend/FrontendActions.h
flang/include/flang/Frontend/FrontendOptions.h
flang/lib/Frontend/CompilerInvocation.cpp
flang/lib/Frontend/FrontendActions.cpp
flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
flang/test/Driver/driver-help.f90
flang/test/HLFIR/flang-experimental-hlfir-flag.f90