Skip to content

Commit a2d340b

Browse files
authored
Revert "[Flang][Driver] Add -print-resource-dir command line flag to emit Flang's resource directory" (#96557)
Reverts #90886 These changes broke linking to compiler-rt on Windows
1 parent 361543e commit a2d340b

File tree

4 files changed

+4
-30
lines changed

4 files changed

+4
-30
lines changed

clang/include/clang/Driver/Driver.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -747,9 +747,6 @@ class Driver {
747747
/// option.
748748
void setDriverMode(StringRef DriverModeValue);
749749

750-
/// Set the resource directory, depending on which driver is being used.
751-
void setResourceDirectory();
752-
753750
/// Parse the \p Args list for LTO options and record the type of LTO
754751
/// compilation based on which -f(no-)?lto(=.*)? option occurs last.
755752
void setLTOMode(const llvm::opt::ArgList &Args);

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5535,10 +5535,7 @@ def print_prog_name_EQ : Joined<["-", "--"], "print-prog-name=">,
55355535
Visibility<[ClangOption, CLOption]>;
55365536
def print_resource_dir : Flag<["-", "--"], "print-resource-dir">,
55375537
HelpText<"Print the resource directory pathname">,
5538-
HelpTextForVariants<[FlangOption],
5539-
"Print the resource directory pathname that contains lib and "
5540-
"include directories with the runtime libraries and MODULE files.">,
5541-
Visibility<[ClangOption, CLOption, FlangOption]>;
5538+
Visibility<[ClangOption, CLOption]>;
55425539
def print_search_dirs : Flag<["-", "--"], "print-search-dirs">,
55435540
HelpText<"Print the paths used for finding libraries and programs">,
55445541
Visibility<[ClangOption, CLOption]>;

clang/lib/Driver/Driver.cpp

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ Driver::Driver(StringRef ClangExecutable, StringRef TargetTriple,
229229
UserConfigDir = static_cast<std::string>(P);
230230
}
231231
#endif
232+
233+
// Compute the path to the resource directory.
234+
ResourceDir = GetResourcesPath(ClangExecutable, CLANG_RESOURCE_DIR);
232235
}
233236

234237
void Driver::setDriverMode(StringRef Value) {
@@ -247,24 +250,6 @@ void Driver::setDriverMode(StringRef Value) {
247250
Diag(diag::err_drv_unsupported_option_argument) << OptName << Value;
248251
}
249252

250-
void Driver::setResourceDirectory() {
251-
// Compute the path to the resource directory, depending on the driver mode.
252-
switch (Mode) {
253-
case GCCMode:
254-
case GXXMode:
255-
case CPPMode:
256-
case CLMode:
257-
case DXCMode:
258-
ResourceDir = GetResourcesPath(ClangExecutable, CLANG_RESOURCE_DIR);
259-
break;
260-
case FlangMode:
261-
SmallString<64> customResourcePathRelativeToDriver{".."};
262-
ResourceDir =
263-
GetResourcesPath(ClangExecutable, customResourcePathRelativeToDriver);
264-
break;
265-
}
266-
}
267-
268253
InputArgList Driver::ParseArgStrings(ArrayRef<const char *> ArgStrings,
269254
bool UseDriverMode, bool &ContainsError) {
270255
llvm::PrettyStackTraceString CrashInfo("Command line argument parsing");
@@ -1217,7 +1202,6 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
12171202
if (!DriverMode.empty())
12181203
setDriverMode(DriverMode);
12191204

1220-
setResourceDirectory();
12211205
// FIXME: What are we going to do with -V and -b?
12221206

12231207
// Arguments specified in command line.

flang/test/Driver/print-resource-dir.F90

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)