[PATCH] D67024: [analyzer] NFC: Replace intrusive list of bug reports with a vector of pointers.

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 6 03:51:38 PDT 2019


gribozavr accepted this revision.
gribozavr added a comment.

Still LGTM, just some nitpicks to replace iterator usage with index-based accesses (which I believe is simpler).



================
Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:569
                                SmallVectorImpl<BugReport *> &bugReports) {
-    return &*eqClass.begin();
+    return eqClass.getReports().begin()->get();
   }
----------------
`getReports()[0]` ?


================
Comment at: clang/lib/StaticAnalyzer/Core/BugReporter.cpp:2803
   assert(I != E);
-  const BugType& BT = I->getBugType();
+  const BugType& BT = (*I)->getBugType();
 
----------------
```
assert(!EQ.getReports().empty());
const BugType& BT = EQ.getReports()[0]->getBugType();
```

?


================
Comment at: clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:3139
+      const auto *R =
+          dyn_cast<PathSensitiveBugReport>(EI->getReports().begin()->get());
       if (!R)
----------------
`getReports()[0]` ?


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

https://reviews.llvm.org/D67024





More information about the cfe-commits mailing list