[PATCH] D63607: [DO NOT SUBMIT] [clang][driver] Prototype --driver-mode=fortran support for new flang

Peter Waller via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 20 08:59:42 PDT 2019


peterwaller-arm created this revision.
Herald added subscribers: cfe-commits, kadircet, ilya-biryukov, mgorny.
Herald added a project: clang.

This is an early prototype, not intended for full review until after the
general approach is agreed. The purpose is to stimulate discussion on
the overall approach. Please see discussion in RFC posted to cfe-dev on
2019-06-20 titled "Adding a fortran mode to the clang driver for flang".

This patch adds a new Fortran mode. When in fortran mode, the driver
will invoke flang instead of falling back to the GCC toolchain as it
would otherwise do.

It is intended that a soon to be implemented binary in the flang project
will import libclangDriver and run the clang driver in the new fortran
mode.

Along with the new mode comes a new ToolChains/Flang.cpp. As the flang
frontend option parser is still prototypical, the implementation inside
this file is not yet fleshed out. It's a straw man.

Additionally, this patch makes "bin/flang" in the clang project, a
symlink to clang. This is only there to support trying the patch out
now, and will be removed when the real thing lands.

Likewise, the patch adds a new "-fc1" by analogy with "-cc1" and tweaks
the logic to facilitate that. This change is only to demonstrate the
overall effect, and will not be present in the real patch. The action of
-fc1 is just to print its command line arguments at the moment, which is
redundant with `-###` anyway. I just wanted to see it invoke a stub
flang with my own eyes.


Repository:
  rC Clang

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/tools/driver/CMakeLists.txt
  clang/tools/driver/driver.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63607.205830.patch
Type: text/x-patch
Size: 15528 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190620/5cad2504/attachment.bin>


More information about the cfe-commits mailing list