[clang] [clang][driver] Don't warn when -S and -c are used together without -fsyntax-only (PR #104477)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 15 11:00:57 PDT 2024


================
@@ -377,8 +377,10 @@ phases::ID Driver::getFinalPhase(const DerivedArgList &DAL,
   // -S only runs up to the backend.
   } else if ((PhaseArg = DAL.getLastArg(options::OPT_S))) {
     FinalPhase = phases::Backend;
+    // Avoid unused argument warnings when combining -S and -c.
+    DAL.ClaimAllArgs(options::OPT_c);
 
-  // -c compilation only runs up to the assembler.
+    // -c compilation only runs up to the assembler.
----------------
ilovepi wrote:

Not sure why `git clang-format` wanted to update this comment, but 🤷 .

https://github.com/llvm/llvm-project/pull/104477


More information about the cfe-commits mailing list