-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "[Flang][Driver] Add -print-resource-dir command line flag to emit Flang's resource directory" #96557
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…emit Fla…" This reverts commit 2df06e4.
@llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-flang-driver Author: David Truby (DavidTruby) ChangesReverts llvm/llvm-project#90886 These changes broke linking to compiler-rt on Windows Full diff: https://github.com/llvm/llvm-project/pull/96557.diff 4 Files Affected:
diff --git a/clang/include/clang/Driver/Driver.h b/clang/include/clang/Driver/Driver.h
index 084c3ffe69ae8..cc1538372d5f8 100644
--- a/clang/include/clang/Driver/Driver.h
+++ b/clang/include/clang/Driver/Driver.h
@@ -747,9 +747,6 @@ class Driver {
/// option.
void setDriverMode(StringRef DriverModeValue);
- /// Set the resource directory, depending on which driver is being used.
- void setResourceDirectory();
-
/// Parse the \p Args list for LTO options and record the type of LTO
/// compilation based on which -f(no-)?lto(=.*)? option occurs last.
void setLTOMode(const llvm::opt::ArgList &Args);
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 6416261077ed1..dfdf0741e28eb 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -5535,10 +5535,7 @@ def print_prog_name_EQ : Joined<["-", "--"], "print-prog-name=">,
Visibility<[ClangOption, CLOption]>;
def print_resource_dir : Flag<["-", "--"], "print-resource-dir">,
HelpText<"Print the resource directory pathname">,
- HelpTextForVariants<[FlangOption],
- "Print the resource directory pathname that contains lib and "
- "include directories with the runtime libraries and MODULE files.">,
- Visibility<[ClangOption, CLOption, FlangOption]>;
+ Visibility<[ClangOption, CLOption]>;
def print_search_dirs : Flag<["-", "--"], "print-search-dirs">,
HelpText<"Print the paths used for finding libraries and programs">,
Visibility<[ClangOption, CLOption]>;
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 0298d22203d9d..33ab7cc3f3968 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -229,6 +229,9 @@ Driver::Driver(StringRef ClangExecutable, StringRef TargetTriple,
UserConfigDir = static_cast<std::string>(P);
}
#endif
+
+ // Compute the path to the resource directory.
+ ResourceDir = GetResourcesPath(ClangExecutable, CLANG_RESOURCE_DIR);
}
void Driver::setDriverMode(StringRef Value) {
@@ -247,24 +250,6 @@ void Driver::setDriverMode(StringRef Value) {
Diag(diag::err_drv_unsupported_option_argument) << OptName << Value;
}
-void Driver::setResourceDirectory() {
- // Compute the path to the resource directory, depending on the driver mode.
- switch (Mode) {
- case GCCMode:
- case GXXMode:
- case CPPMode:
- case CLMode:
- case DXCMode:
- ResourceDir = GetResourcesPath(ClangExecutable, CLANG_RESOURCE_DIR);
- break;
- case FlangMode:
- SmallString<64> customResourcePathRelativeToDriver{".."};
- ResourceDir =
- GetResourcesPath(ClangExecutable, customResourcePathRelativeToDriver);
- break;
- }
-}
-
InputArgList Driver::ParseArgStrings(ArrayRef<const char *> ArgStrings,
bool UseDriverMode, bool &ContainsError) {
llvm::PrettyStackTraceString CrashInfo("Command line argument parsing");
@@ -1217,7 +1202,6 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
if (!DriverMode.empty())
setDriverMode(DriverMode);
- setResourceDirectory();
// FIXME: What are we going to do with -V and -b?
// Arguments specified in command line.
diff --git a/flang/test/Driver/print-resource-dir.F90 b/flang/test/Driver/print-resource-dir.F90
deleted file mode 100644
index 8fd35f1800df2..0000000000000
--- a/flang/test/Driver/print-resource-dir.F90
+++ /dev/null
@@ -1,4 +0,0 @@
-! DEFINE: %{resource_dir} = %S/Inputs/resource_dir
-! RUN: %flang -print-resource-dir -resource-dir=%{resource_dir}.. \
-! RUN: | FileCheck -check-prefix=PRINT-RESOURCE-DIR -DFILE=%{resource_dir} %s
-! PRINT-RESOURCE-DIR: [[FILE]]
|
mjklemm
added a commit
that referenced
this pull request
Jun 28, 2024
This PR re-enables the command line option `-print-resources-dir` after PR #96557 has reverted the changes made. The way this works now, is that it simply prints the current resource dir, which points to clang/$version.
lravenclaw
pushed a commit
to lravenclaw/llvm-project
that referenced
this pull request
Jul 3, 2024
This PR re-enables the command line option `-print-resources-dir` after PR llvm#96557 has reverted the changes made. The way this works now, is that it simply prints the current resource dir, which points to clang/$version.
AlexisPerry
pushed a commit
to llvm-project-tlp/llvm-project
that referenced
this pull request
Jul 9, 2024
…emit Flang's resource directory" (llvm#96557) Reverts llvm#90886 These changes broke linking to compiler-rt on Windows
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
clang:driver
'clang' and 'clang++' user-facing binaries. Not 'clang-cl'
clang
Clang issues not falling into any other category
flang:driver
flang
Flang issues not falling into any other category
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts #90886
These changes broke linking to compiler-rt on Windows