Szelethus added a comment.

First off, your patch is great, and I'm pretty sure we want it!

I remember working around here, and I either have never quite understood what 
makes `exampleReport` an example, or have long forgotten. Can we not just 
rename it to `chosenReport`, or simply `report`?



================
Comment at: clang/lib/StaticAnalyzer/Core/BugReporter.cpp:3068-3078
+  const BugReport *report = findReportInEquivalenceClass(EQ, bugReports);
   if (!report)
     return;
 
   // See whether we need to silence the checker/package.
   for (const std::string &CheckerOrPackage :
        getAnalyzerOptions().SilencedCheckersAndPackages) {
----------------
Wouldn't it make more sense to create initialize (instead of resetting) 
`report` at the call to `generateDiagnosticForConsumerMap()`? This just looks a 
bit convoluted. We could turn everything up to that point into a 
[[https://llvm.org/docs/CodingStandards.html#turn-predicate-loops-into-predicate-functions
 | predicate function]].


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115716

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to