[clang] 4c1a6a2 - [flang][Driver] Support -Qunused-arguments (#107462)

via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 6 11:33:55 PDT 2024


Author: Tarun Prabhu
Date: 2024-09-06T12:33:51-06:00
New Revision: 4c1a6a29cce08cd6229a0c5a8b18a8319588d858

URL: https://github.com/llvm/llvm-project/commit/4c1a6a29cce08cd6229a0c5a8b18a8319588d858
DIFF: https://github.com/llvm/llvm-project/commit/4c1a6a29cce08cd6229a0c5a8b18a8319588d858.diff

LOG: [flang][Driver] Support -Qunused-arguments (#107462)

This partially addresses:
https://github.com/llvm/llvm-project/issues/89888

Added: 
    flang/test/Driver/q-unused-arguments.f90

Modified: 
    clang/include/clang/Driver/Options.td

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 1142416e227fc8..37e80c24be3214 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


        


More information about the cfe-commits mailing list