From 0867d4157328169c570f4d1e9c01806624035873 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Wed, 8 Feb 2023 10:13:12 -0600 Subject: [PATCH] [flang] don't require -flang-experimental-exec flag anymore Reviewed By: awarzynski, PeteSteinfeld Differential Revision: https://reviews.llvm.org/D153379 --- clang/include/clang/Driver/Options.td | 4 ---- clang/lib/Driver/ToolChains/CommonArgs.cpp | 6 ------ flang/docs/FlangDriver.md | 12 ++---------- flang/test/Driver/driver-help-hidden.f90 | 2 -- flang/test/Driver/linker-flags.f90 | 8 ++++---- 5 files changed, 6 insertions(+), 26 deletions(-) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index cf002e772df0..69239e6cf296 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -5279,10 +5279,6 @@ def fno_sycl : Flag<["-"], "fno-sycl">, Flags<[NoXarchOption, CoreOption]>, // FLangOption + NoXarchOption //===----------------------------------------------------------------------===// -def flang_experimental_exec : Flag<["-"], "flang-experimental-exec">, - Flags<[FlangOption, FlangOnlyOption, NoXarchOption, HelpHidden]>, - HelpText<"Enable support for generating executables (experimental)">; - def flang_experimental_hlfir : Flag<["-"], "flang-experimental-hlfir">, Flags<[FlangOption, FC1Option, FlangOnlyOption, NoXarchOption, HelpHidden]>, HelpText<"Use HLFIR lowering (experimental)">; diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp index 2d9392893bc3..4afe3cc1f7a6 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -935,12 +935,6 @@ void tools::addFortranRuntimeLibs(const ToolChain &TC, void tools::addFortranRuntimeLibraryPath(const ToolChain &TC, const llvm::opt::ArgList &Args, ArgStringList &CmdArgs) { - // NOTE: Generating executables by Flang is considered an "experimental" - // feature and hence this is guarded with a command line option. - // TODO: Make this work unconditionally once Flang is mature enough. - if (!Args.hasArg(options::OPT_flang_experimental_exec)) - return; - // Default to the /../lib directory. This works fine on the // platforms that we have tested so far. We will probably have to re-fine // this in the future. In particular, on some platforms, we may need to use diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md index 6c2a47382063..11e86289cd6f 100644 --- a/flang/docs/FlangDriver.md +++ b/flang/docs/FlangDriver.md @@ -149,11 +149,6 @@ flang-new -ccc-print-phases -c file.f +- 3: backend, {2}, assembler 4: assembler, {3}, object ``` -Note that currently Flang does not support code-generation and `flang-new` will -fail during the second step above with the following error: -```bash -error: code-generation is not available yet -``` The other phases are printed nonetheless when using `-ccc-print-phases`, as that reflects what `clangDriver`, the library, will try to create and run. @@ -330,16 +325,13 @@ As of [#7246](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7246) supported Fortran compiler. You can configure your CMake projects to use `flang-new` as follows: ```bash -cmake -DCMAKE_Fortran_FLAGS="-flang-experimental-exec" -DCMAKE_Fortran_COMPILER= +cmake -DCMAKE_Fortran_COMPILER= ``` You should see the following in the output: ``` -- The Fortran compiler identification is LLVMFlang ``` -where `` corresponds to the LLVM Flang version. Note that while -generating executables remains experimental, you will need to inform CMake to -use the `-flang-experimental-exec` flag when invoking `flang-new` as in the -example above. +where `` corresponds to the LLVM Flang version. # Testing In LIT, we define two variables that you can use to invoke Flang's drivers: diff --git a/flang/test/Driver/driver-help-hidden.f90 b/flang/test/Driver/driver-help-hidden.f90 index 002b30cfe283..d8b1a03d4c0d 100644 --- a/flang/test/Driver/driver-help-hidden.f90 +++ b/flang/test/Driver/driver-help-hidden.f90 @@ -39,8 +39,6 @@ ! CHECK-NEXT: -finput-charset= Specify the default character set for source files ! CHECK-NEXT: -fintrinsic-modules-path ! CHECK-NEXT: Specify where to find the compiled intrinsic modules -! CHECK-NEXT: -flang-experimental-exec -! CHECK-NEXT: Enable support for generating executables (experimental) ! CHECK-NEXT: -flang-experimental-hlfir ! CHECK-NEXT: Use HLFIR lowering (experimental) ! CHECK-NEXT: -flarge-sizes Use INTEGER(KIND=8) for the result type in size-related intrinsics diff --git a/flang/test/Driver/linker-flags.f90 b/flang/test/Driver/linker-flags.f90 index e1350b74ae30..910d246237f7 100644 --- a/flang/test/Driver/linker-flags.f90 +++ b/flang/test/Driver/linker-flags.f90 @@ -2,15 +2,15 @@ ! invocation. These libraries are added on top of other standard runtime ! libraries that the Clang driver will include. -! RUN: %flang -### -flang-experimental-exec -target ppc64le-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,GNU -! RUN: %flang -### -flang-experimental-exec -target aarch64-apple-darwin %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,DARWIN -! RUN: %flang -### -flang-experimental-exec -target x86_64-windows-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,MINGW +! RUN: %flang -### -target ppc64le-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,GNU +! RUN: %flang -### -target aarch64-apple-darwin %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,DARWIN +! RUN: %flang -### -target x86_64-windows-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,MINGW ! NOTE: Clang's driver library, clangDriver, usually adds 'libcmt' and ! 'oldnames' on Windows, but they are not needed when compiling ! Fortran code and they might bring in additional dependencies. ! Make sure they're not added. -! RUN: %flang -### -flang-experimental-exec -target aarch64-windows-msvc %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,MSVC --implicit-check-not libcmt --implicit-check-not oldnames +! RUN: %flang -### -target aarch64-windows-msvc %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,MSVC --implicit-check-not libcmt --implicit-check-not oldnames ! Compiler invocation to generate the object file ! CHECK-LABEL: {{.*}} "-emit-obj"