diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -5279,10 +5279,6 @@ // 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 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -935,12 +935,6 @@ 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 --- a/flang/docs/FlangDriver.md +++ b/flang/docs/FlangDriver.md @@ -149,11 +149,6 @@ +- 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 @@ 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 --- 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 --- 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"