[PATCH] D110673: [clang] Don't modify OptRemark if the argument is not relevant

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 28 18:42:54 PDT 2021


aeubanks created this revision.
aeubanks requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

A followup to D110201 <https://reviews.llvm.org/D110201>.

For example, we'd set OptimizationRemarkMissed's Regex to '.*' when
encountering -Rpass.  This doesn't actually affect remarks we emit
because in clang::ProcessWarningOptions() we'll separately look at all
-R arguments and turn on/off corresponding diagnostic groups.

Downstream users have somehow noticed this.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110673

Files:
  clang/lib/Frontend/CompilerInvocation.cpp


Index: clang/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- clang/lib/Frontend/CompilerInvocation.cpp
+++ clang/lib/Frontend/CompilerInvocation.cpp
@@ -1201,6 +1201,8 @@
         Result.Kind = CodeGenOptions::RK_Disabled;
       else if (Value == "no-everything")
         Result.Kind = CodeGenOptions::RK_DisabledEverything;
+      else
+        continue;
 
       if (Result.Kind == CodeGenOptions::RK_Disabled ||
           Result.Kind == CodeGenOptions::RK_DisabledEverything) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110673.375759.patch
Type: text/x-patch
Size: 544 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210929/4db87595/attachment.bin>


More information about the cfe-commits mailing list