[PATCH] D103086: [clang][ARM] When handling multiple -mimplicit-it mark all as used

David Spickett via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 25 07:53:15 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8427053f8192: [clang][ARM] When handling multiple -mimplicit-it mark all as used (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103086/new/

https://reviews.llvm.org/D103086

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/arm-target-as-mimplicit-it.s


Index: clang/test/Driver/arm-target-as-mimplicit-it.s
===================================================================
--- clang/test/Driver/arm-target-as-mimplicit-it.s
+++ clang/test/Driver/arm-target-as-mimplicit-it.s
@@ -35,6 +35,8 @@
 // RUN: %clang -target arm-linux-gnueabi -### -Wa,-mimplicit-it=always,-mimplicit-it=foo %s 2>&1 | FileCheck %s --check-prefix=INVALID
 
 
+/// Check that the argument we ignore is still marked as used.
+// ALWAYS-NOT: warning: argument unused during compilation: {{.*}}-mimplicit-it={{.*}}
 /// Check that there isn't a second -arm-implicit-it before or after the one
 /// that was the indended match.
 // ALWAYS-NOT: "-arm-implicit-it={{.*}}"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -2410,6 +2410,8 @@
   for (const Arg *A :
        Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler,
                      options::OPT_mimplicit_it_EQ)) {
+    A->claim();
+
     if (A->getOption().getID() == options::OPT_mimplicit_it_EQ) {
       switch (C.getDefaultToolChain().getArch()) {
       case llvm::Triple::arm:
@@ -2427,8 +2429,6 @@
       }
     }
 
-    A->claim();
-
     for (StringRef Value : A->getValues()) {
       if (TakeNextArg) {
         CmdArgs.push_back(Value.data());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103086.347676.patch
Type: text/x-patch
Size: 1397 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210525/dc6e9f7b/attachment.bin>


More information about the cfe-commits mailing list