They are said to be more efficient and they're definitely less brain-damaging. Suggested by @gribozavr.
Details
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
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Thanks for the simplification!
clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h | ||
---|---|---|
460 ↗ | (On Diff #218177) | 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 | ||
---|---|---|
460 ↗ | (On Diff #218177) | 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. |
460 ↗ | (On Diff #218177) | BugReports would be a better name. |
Comment Actions
Other then the things @gribozavr mentioned, LGTM.
clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h | ||
---|---|---|
458 ↗ | (On Diff #218177) | Prefer using. |
Comment Actions
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 ↗ | (On Diff #219011) | getReports()[0] ? |
clang/lib/StaticAnalyzer/Core/BugReporter.cpp | ||
2803 ↗ | (On Diff #219011) | assert(!EQ.getReports().empty()); const BugType& BT = EQ.getReports()[0]->getBugType(); ? |
clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | ||
3139 ↗ | (On Diff #219011) | getReports()[0] ? |
clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h | ||
---|---|---|
569 ↗ | (On Diff #219011) | Mm right :) |