Skip to content

[flang][Driver] Support -Qunused-arguments #107462

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 1 commit into from
Sep 6, 2024

Conversation

tarunprabhu
Copy link
Contributor

This partially addresses: #89888

@llvmbot llvmbot added clang Clang issues not falling into any other category flang:driver flang Flang issues not falling into any other category labels Sep 5, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 5, 2024

@llvm/pr-subscribers-flang-driver

@llvm/pr-subscribers-clang

Author: Tarun Prabhu (tarunprabhu)

Changes

This partially addresses: #89888


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

2 Files Affected:

  • (modified) clang/include/clang/Driver/Options.td (+1-1)
  • (added) flang/test/Driver/q-unused-arguments.f90 (+5)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 1b9b3f2c6600a3..e3a98bab2a5020 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -949,7 +949,7 @@ def : Flag<["-"], "fident">, Group<f_Group>, Alias<Qy>,
 def : Flag<["-"], "fno-ident">, Group<f_Group>, Alias<Qn>,
   Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>;
 def Qunused_arguments : Flag<["-"], "Qunused-arguments">,
-  Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
+  Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
   HelpText<"Don't emit warning for unused driver arguments">;
 def Q : Flag<["-"], "Q">, IgnoredGCCCompat;
 def S : Flag<["-"], "S">, Flags<[NoXarchOption]>,
diff --git a/flang/test/Driver/q-unused-arguments.f90 b/flang/test/Driver/q-unused-arguments.f90
new file mode 100644
index 00000000000000..95210da888fc55
--- /dev/null
+++ b/flang/test/Driver/q-unused-arguments.f90
@@ -0,0 +1,5 @@
+! RUN: %flang -Qunused-arguments -c -o /dev/null %s -L. 2>&1 | FileCheck %s --allow-empty
+
+! CHECK-NOT: argument unused during compilation
+
+end program

Copy link
Contributor

@kiranchandramohan kiranchandramohan left a comment

Choose a reason for hiding this comment

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

LG.

@tarunprabhu tarunprabhu merged commit 4c1a6a2 into llvm:main Sep 6, 2024
12 checks passed
@tarunprabhu tarunprabhu deleted the support-Qunused-arguments branch September 6, 2024 18:33
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.

3 participants