diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md --- a/flang/docs/FlangDriver.md +++ b/flang/docs/FlangDriver.md @@ -18,9 +18,8 @@ * the frontend driver, `flang-new -fc1` > **_NOTE:_** The diagrams in this document refer to `flang` as opposed to -> `flang-new`. This is because the diagrams reflect the final design that we -> are still working towards. See the note on [the flang script](https://github.com/llvm/llvm-project/blob/main/flang/docs/FlangDriver.md#the-flang-script) -> below for more context. +> `flang-new`. Eventually, `flang-new` will be renamed as `flang` and the +> diagrams reflect the final design that we are still working towards. The **compiler driver** will allow you to control all compilation phases (e.g. preprocessing, semantic checks, code-generation, code-optimisation, lowering @@ -206,32 +205,25 @@ words, `flang-new -fc1 ` is equivalent to `flang-new -fc1 -fsyntax-only `. -## The `flang` script -The `flang` wrapper script for `flang-new` was introduced as a development tool -and to facilitate testing. While code-generation is not available in Flang, you -can use it as a drop-in replacement for other Fortran compilers in your build -scripts. - -The `flang` wrapper script will: +## The `flang-to-external-fc` script +The `flang-to-external-fc` wrapper script for `flang-new` was introduced as a +development tool and to facilitate testing. The `flang-to-external-fc` wrapper +script will: * use `flang-new` to unparse the input source file (i.e. it will run `flang-new -fc1 -fdebug-unparse `), and then * call a host Fortran compiler, e.g. `gfortran`, to compile the unparsed file. -Here's a basic breakdown of what happens inside `flang` when you run `flang -file.f90`: +Here's a basic breakdown of what happens inside `flang-to-external-fc` when you +run `flang-to-external-fc file.f90`: ```bash flang-new -fc1 -fdebug-unparse file.f90 -o file-unparsed.f90 gfortran file-unparsed.f90 ``` This is a simplified version for illustration purposes only. In practice, -`flang` adds a few more frontend options and it also supports various other use -cases (e.g. compiling C files, linking existing object files). `gfortran` is -the default host compiler used by `flang`. You can change it by setting the -`FLANG_FC` environment variable. - -Our intention is to replace `flang` with `flang-new`. Please consider `flang` -as a temporary substitute for Flang's compiler driver while the actual driver -is in development. +`flang-to-external-fc` adds a few more frontend options and it also supports +various other use cases (e.g. compiling C files, linking existing object +files). `gfortran` is the default host compiler used by `flang-to-external-fc`. +You can change it by setting the `FLANG_FC` environment variable. ## Adding new Compiler Options Adding a new compiler option in Flang consists of two steps: diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt --- a/flang/tools/f18/CMakeLists.txt +++ b/flang/tools/f18/CMakeLists.txt @@ -56,9 +56,6 @@ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/flang-to-external-fc ${CMAKE_BINARY_DIR}/bin) add_custom_target(flang-to-external-fc ALL DEPENDS ${CMAKE_BINARY_DIR}/bin/flang-to-external-fc) install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/flang-to-external-fc DESTINATION "${CMAKE_INSTALL_BINDIR}") - add_custom_target(flang-slink ALL DEPENDS ${CMAKE_BINARY_DIR}/bin/flang-to-external-fc COMMAND ${CMAKE_COMMAND} -E create_symlink - ${CMAKE_BINARY_DIR}/bin/flang-to-external-fc ${CMAKE_BINARY_DIR}/bin/flang) - install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/flang DESTINATION "${CMAKE_INSTALL_BINDIR}") endif() # TODO Move this to a more suitable location diff --git a/flang/tools/f18/flang-to-external-fc b/flang/tools/f18/flang-to-external-fc --- a/flang/tools/f18/flang-to-external-fc +++ b/flang/tools/f18/flang-to-external-fc @@ -1,5 +1,5 @@ #! /usr/bin/env bash -#===-- tools/f18/flang.sh -----------------------------------------*- sh -*-===# +#===-- tools/f18/flang-te-external-fc.sh --------------------------*- sh -*-===# # # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information.