Skip to content

[Flang] Re-enable -print-resource-dir compiler option #96799

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

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

mjklemm
Copy link
Contributor

@mjklemm mjklemm commented Jun 26, 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.

@mjklemm mjklemm requested review from DavidTruby and kkwli June 26, 2024 17:03
@mjklemm mjklemm self-assigned this Jun 26, 2024
@llvmbot llvmbot added clang Clang issues not falling into any other category flang:driver flang Flang issues not falling into any other category labels Jun 26, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 26, 2024

@llvm/pr-subscribers-flang-driver

@llvm/pr-subscribers-clang

Author: Michael Klemm (mjklemm)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/96799.diff

2 Files Affected:

  • (modified) clang/include/clang/Driver/Options.td (+4-1)
  • (added) flang/test/Driver/print-resource-dir.F90 (+4)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index dd55838dcf384b..4c514197de3ac9 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -5535,7 +5535,10 @@ 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">,
-  Visibility<[ClangOption, CLOption]>;
+  HelpTextForVariants<[FlangOption],
+                      "Print the resource directory pathname that contains lib and "
+                      "include directories with the runtime libraries and MODULE files.">,
+  Visibility<[ClangOption, CLOption, FlangOption]>;
 def print_search_dirs : Flag<["-", "--"], "print-search-dirs">,
   HelpText<"Print the paths used for finding libraries and programs">,
   Visibility<[ClangOption, CLOption]>;
diff --git a/flang/test/Driver/print-resource-dir.F90 b/flang/test/Driver/print-resource-dir.F90
new file mode 100644
index 00000000000000..8fd35f1800df21
--- /dev/null
+++ b/flang/test/Driver/print-resource-dir.F90
@@ -0,0 +1,4 @@
+! 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]]

Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidTruby is on holiday

We have tested this on our end and it does not re-introduce the issue. Thanks for the revert & fix!

Copy link
Collaborator

@kkwli kkwli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG. Thanks.

@mjklemm mjklemm merged commit 66f55a7 into llvm:main Jun 28, 2024
11 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category flang:driver flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants