They are said to be more efficient and they're definitely less brain-damaging. Suggested by @gribozavr.
Details
- Reviewers
dcoughlin xazax.hun a_sidorin rnkovacs Szelethus baloghadamsoftware Charusso gribozavr - Commits
- rG589273bebd44: [analyzer] NFC: Simplify bug report equivalence classes to not be ilists.
rL371451: [analyzer] NFC: Simplify bug report equivalence classes to not be ilists.
rC371451: [analyzer] NFC: Simplify bug report equivalence classes to not be ilists.
Diff Detail
Event Timeline
Thanks for the simplification!
| clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h | ||
|---|---|---|
| 470 | I don't think we intend users to use ReportList, so it would be better to not expose it. Instead: using iterator = SmallVectorImpl<std::unique_ptr<BugReport>>::iterator; using const_iterator = SmallVectorImpl<std::unique_ptr<BugReport>>::const_iterator; ... and move it closer to the usage point, right above begin() / end(). WDYT? | |
| clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h | ||
|---|---|---|
| 470 | Could even do away with all these typedefs, and four begin/end overloads, and replace everything with: ArrayRef<std::unique_ptr<BugReport>> Reports() const; I believe we don't even need a non-const overload since unique_ptr allows mutations regardless. | |
| 470 | BugReports would be a better name. | |
Other then the things @gribozavr mentioned, LGTM.
| clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h | ||
|---|---|---|
| 468 | Prefer using. | |
Still LGTM, just some nitpicks to replace iterator usage with index-based accesses (which I believe is simpler).
| clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h | ||
|---|---|---|
| 569 | getReports()[0] ? | |
| clang/lib/StaticAnalyzer/Core/BugReporter.cpp | ||
| 2803 | assert(!EQ.getReports().empty()); const BugType& BT = EQ.getReports()[0]->getBugType(); ? | |
| clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | ||
| 3139 | getReports()[0] ? | |
| clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h | ||
|---|---|---|
| 569 | Mm right :) | |
Prefer using.