[PATCH] D63607: [clang][driver] Add basic --driver-mode=flang support for fortran

Peter Waller via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 19 06:21:33 PDT 2019


peterwaller-arm updated this revision to Diff 220856.
peterwaller-arm marked 14 inline comments as done.
peterwaller-arm edited the summary of this revision.
peterwaller-arm added a comment.

Thanks everyone for your comments.

Changes since last patch:

- Reintroduce handling of (no phase arg specified), -S, -emit-llvm, etc.

  The code implementing it was reordered for clarity.

  After internal discussion we concluded it was preferable to land these now even though they are unimplemented on the frontend side, in order to avoid giving assertion errors for unimplemented behaviour.

  It is planned that the frontend will emit sensible errors for unimplemented behaviour.

- Fixes to the cover letter for --driver-mode=fortran => --driver-mode=flang

- Add a test (flang-not-installed.f90) which demonstrates the error message if clang is invoked with no flang available, by unsetting PATH. This is a non-"-###" test which also does not depend on the presence of flang.
  - Since it uses shell syntax, it is marked unsupported on windows.

- In response to a private comment, Flang mode now coerces TY_PP_Fortran to TY_Fortran. This:
  - Leaves the legacy behaviour unchanged
  - Ensures that we do not emit a warning when passing TY_PP_Fortran inputs to -E
  - Should ensure that TY_PP_Fortran is treated exactly as a fortran file
  - Is consistent with f18's intent to not have any notion of preprocessed sources
  - Now the flang.f90 and flang.F90 <https://reviews.llvm.org/F90> tests are identical except for the filename

- Various minor whitespace changes and documentation fixes.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63607/new/

https://reviews.llvm.org/D63607

Files:
  clang/include/clang/Driver/Driver.h
  clang/include/clang/Driver/ToolChain.h
  clang/include/clang/Driver/Types.h
  clang/lib/Driver/CMakeLists.txt
  clang/lib/Driver/Driver.cpp
  clang/lib/Driver/ToolChain.cpp
  clang/lib/Driver/ToolChains/Flang.cpp
  clang/lib/Driver/ToolChains/Flang.h
  clang/lib/Driver/Types.cpp
  clang/test/Driver/flang/Inputs/one.f90
  clang/test/Driver/flang/Inputs/other.c
  clang/test/Driver/flang/Inputs/two.f90
  clang/test/Driver/flang/flang-not-installed.f90
  clang/test/Driver/flang/flang.F90
  clang/test/Driver/flang/flang.f90
  clang/test/Driver/flang/multiple-inputs-mixed.f90
  clang/test/Driver/flang/multiple-inputs.f90
  clang/test/Driver/fortran.f95
  clang/test/Driver/lit.local.cfg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63607.220856.patch
Type: text/x-patch
Size: 20291 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190919/2fd8c94a/attachment-0001.bin>


More information about the cfe-commits mailing list