Skip to content

Commit 06eb10d

Browse files
everythingfunctionalh-vetinaribanach-space
authored
[flang][driver] rename flang-new to flang (llvm#110023)
This does a global rename from `flang-new` to `flang`. I also removed/changed any TODOs that I found related to making this change. --------- Co-authored-by: H. Vetinari <[email protected]> Co-authored-by: Andrzej Warzynski <[email protected]>
1 parent f1eac77 commit 06eb10d

File tree

70 files changed

+249
-228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+249
-228
lines changed

.github/workflows/release-binaries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ jobs:
328328
run: |
329329
# Build some of the mlir tools that take a long time to link
330330
if [ "${{ needs.prepare.outputs.build-flang }}" = "true" ]; then
331-
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang-new bbc
331+
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang bbc
332332
fi
333333
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ \
334334
mlir-bytecode-parser-fuzzer \

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ def warn_drv_unsupported_option_for_processor : Warning<
147147
def warn_drv_unsupported_openmp_library : Warning<
148148
"the library '%0=%1' is not supported, OpenMP will not be enabled">,
149149
InGroup<OptionIgnored>;
150+
def warn_openmp_experimental : Warning<
151+
"OpenMP support in flang is still experimental">,
152+
InGroup<ExperimentalOption>;
150153

151154
def err_drv_invalid_thread_model_for_target : Error<
152155
"invalid thread model '%0' in '%1' for this target">;

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,3 +1583,7 @@ def ExtractAPIMisuse : DiagGroup<"extractapi-misuse">;
15831583
// Warnings about using the non-standard extension having an explicit specialization
15841584
// with a storage class specifier.
15851585
def ExplicitSpecializationStorageClass : DiagGroup<"explicit-specialization-storage-class">;
1586+
1587+
// A warning for options that enable a feature that is not yet complete
1588+
def ExperimentalOption : DiagGroup<"experimental-option">;
1589+

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6077,7 +6077,7 @@ def _sysroot_EQ : Joined<["--"], "sysroot=">, Visibility<[ClangOption, FlangOpti
60776077
def _sysroot : Separate<["--"], "sysroot">, Alias<_sysroot_EQ>;
60786078

60796079
//===----------------------------------------------------------------------===//
6080-
// pie/pic options (clang + flang-new)
6080+
// pie/pic options (clang + flang)
60816081
//===----------------------------------------------------------------------===//
60826082
let Visibility = [ClangOption, FlangOption] in {
60836083

@@ -6093,7 +6093,7 @@ def fno_pie : Flag<["-"], "fno-pie">, Group<f_Group>;
60936093
} // let Vis = [Default, FlangOption]
60946094

60956095
//===----------------------------------------------------------------------===//
6096-
// Target Options (clang + flang-new)
6096+
// Target Options (clang + flang)
60976097
//===----------------------------------------------------------------------===//
60986098
let Flags = [TargetSpecific] in {
60996099
let Visibility = [ClangOption, FlangOption] in {

clang/lib/Driver/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2029,7 +2029,7 @@ void Driver::PrintHelp(bool ShowHidden) const {
20292029

20302030
void Driver::PrintVersion(const Compilation &C, raw_ostream &OS) const {
20312031
if (IsFlangMode()) {
2032-
OS << getClangToolFullVersion("flang-new") << '\n';
2032+
OS << getClangToolFullVersion("flang") << '\n';
20332033
} else {
20342034
// FIXME: The following handlers should use a callback mechanism, we don't
20352035
// know what the client would like to do.

clang/lib/Driver/ToolChain.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,9 @@ static const DriverSuffix *FindDriverSuffix(StringRef ProgName, size_t &Pos) {
386386
{"cl", "--driver-mode=cl"},
387387
{"++", "--driver-mode=g++"},
388388
{"flang", "--driver-mode=flang"},
389+
// For backwards compatibility, we create a symlink for `flang` called
390+
// `flang-new`. This will be removed in the future.
391+
{"flang-new", "--driver-mode=flang"},
389392
{"clang-dxc", "--driver-mode=dxc"},
390393
};
391394

clang/lib/Driver/ToolChains/Flang.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,9 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA,
787787

788788
if (Args.hasArg(options::OPT_fopenmp_force_usm))
789789
CmdArgs.push_back("-fopenmp-force-usm");
790+
// TODO: OpenMP support isn't "done" yet, so for now we warn that it
791+
// is experimental.
792+
D.Diag(diag::warn_openmp_experimental);
790793

791794
// FIXME: Clang supports a whole bunch more flags here.
792795
break;
@@ -881,14 +884,12 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA,
881884

882885
CmdArgs.push_back(Input.getFilename());
883886

884-
// TODO: Replace flang-new with flang once the new driver replaces the
885-
// throwaway driver
886-
const char *Exec = Args.MakeArgString(D.GetProgramPath("flang-new", TC));
887+
const char *Exec = Args.MakeArgString(D.GetProgramPath("flang", TC));
887888
C.addCommand(std::make_unique<Command>(JA, *this,
888889
ResponseFileSupport::AtFileUTF8(),
889890
Exec, CmdArgs, Inputs, Output));
890891
}
891892

892-
Flang::Flang(const ToolChain &TC) : Tool("flang-new", "flang frontend", TC) {}
893+
Flang::Flang(const ToolChain &TC) : Tool("flang", "flang frontend", TC) {}
893894

894895
Flang::~Flang() {}

clang/test/Driver/flang/flang.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
! * (no type specified, resulting in an object file)
1414

1515
! All invocations should begin with flang -fc1, consume up to here.
16-
! ALL-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1"
16+
! ALL-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1"
1717

1818
! Check that f90 files are not treated as "previously preprocessed"
1919
! ... in --driver-mode=flang.

clang/test/Driver/flang/flang_ucase.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
! * (no type specified, resulting in an object file)
1414

1515
! All invocations should begin with flang -fc1, consume up to here.
16-
! ALL-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1"
16+
! ALL-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1"
1717

1818
! Check that f90 files are not treated as "previously preprocessed"
1919
! ... in --driver-mode=flang.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
! Check that flang can handle mixed C and fortran inputs.
22

33
! RUN: %clang --driver-mode=flang -### -fsyntax-only %S/Inputs/one.f90 %S/Inputs/other.c 2>&1 | FileCheck --check-prefixes=CHECK-SYNTAX-ONLY %s
4-
! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang-new{{[^"/]*}}" "-fc1"
4+
! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1"
55
! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90"
66
! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}clang{{[^"/]*}}" "-cc1"
77
! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/other.c"

0 commit comments

Comments
 (0)