[PATCH] D79092: [Flang][Driver]Add new flang driver main() entrypoint

Caroline via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 08:00:58 PDT 2020


CarolineConcatto created this revision.
Herald added subscribers: llvm-commits, kristof.beyls, mgorny.
Herald added a reviewer: DavidTruby.
Herald added a reviewer: sscalpone.
Herald added a project: LLVM.

Depends on D73951 <https://reviews.llvm.org/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 <https://reviews.llvm.org/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 at arm.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79092

Files:
  flang/CMakeLists.txt
  flang/include/flang/Frontend/TextDiagnosticPrinter.h
  flang/lib/CMakeLists.txt
  flang/lib/Frontend/CMakeLists.txt
  flang/lib/Frontend/TextDiagnosticPrinter.cpp
  flang/test/Driver/flang.F90
  flang/test/Driver/flang.f90
  flang/test/lit.cfg.py
  flang/tools/CMakeLists.txt
  flang/tools/flang/CMakeLists.txt
  flang/tools/flang/driver.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79092.260914.patch
Type: text/x-patch
Size: 13890 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200429/a105996b/attachment.bin>


More information about the llvm-commits mailing list