Depends on D73951
This work implements the "driver" part of an RFC sent to cfe-dev in [1].
The entry point adds a binary called bin/flang-tmp because ATM flang is in use
by flang.sh.
The goal is to have the old flang.sh removed from the install to make way
for flang-tmp.
bin/flang-tmp is implemented in terms of clang::Driver, defaulting to the
--driver-mode=flang added to clang in [2]. Therefore it adds libClang in
the CMake.
This patch uses a new flag ('fortran-fe' for fortran frontend) introduced
in [3], which is under review. bin/flang-tmp will select the frontend
flang-tmp -fc1 instead of flang -fc1 (in the code we set -fortran-fe=flang-tmp)
while flang is at use.
Regression tests are added in test/driver, which mirror some tests in the
clang/test/Driver directory, flang.f90 and flang.F90. The primary difference is
that the clang tests run clang --driver-mode=flang <input>, whereas these tests
run flang <input>.
[1] "RFC: Adding a fortran mode to the clang driver for flang"
http://lists.llvm.org/pipermail/cfe-dev/2019-June/062669.html
[2] [clang][driver] Add basic --driver-mode=flang support for fortran
https://reviews.llvm.org/D63607
[3][Clang][Driver]Add logic to search for flang frontend
https://reviews.llvm.org/D73951
Signed-off-by: Caroline Concatto <caroline.concatto@arm.com>
This is a mistake. The patch works with -Werror. I'll revert this