diff options
| author | Artem Dergachev <artem.dergachev@gmail.com> | 2019-09-09 20:34:44 +0000 |
|---|---|---|
| committer | Artem Dergachev <artem.dergachev@gmail.com> | 2019-09-09 20:34:44 +0000 |
| commit | 589273bebd44c3fcc09d2ad87b259dcaff30d299 (patch) | |
| tree | 88ea835ea0b51dc885ab90582826fa42aadb5adc /clang/lib/StaticAnalyzer/Core/BugReporter.cpp | |
| parent | 2f169e7cdd9973d2aa4cba6b0a09126a5e7268ec (diff) | |
| download | bcm5719-llvm-589273bebd44c3fcc09d2ad87b259dcaff30d299.tar.gz bcm5719-llvm-589273bebd44c3fcc09d2ad87b259dcaff30d299.zip | |
[analyzer] NFC: Simplify bug report equivalence classes to not be ilists.
Use a vector of unique pointers instead.
Differential Revision: https://reviews.llvm.org/D67024
llvm-svn: 371451
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index 331d7379577..d3dacc78922 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -2798,17 +2798,15 @@ struct FRIEC_WLItem { BugReport *PathSensitiveBugReporter::findReportInEquivalenceClass( BugReportEquivClass &EQ, SmallVectorImpl<BugReport *> &bugReports) { - BugReportEquivClass::iterator I = EQ.begin(), E = EQ.end(); - assert(I != E); - const BugType& BT = I->getBugType(); - // If we don't need to suppress any of the nodes because they are // post-dominated by a sink, simply add all the nodes in the equivalence class // to 'Nodes'. Any of the reports will serve as a "representative" report. + assert(EQ.getReports().size() > 0); + const BugType& BT = EQ.getReports()[0]->getBugType(); if (!BT.isSuppressOnSink()) { - BugReport *R = &*I; - for (auto &I : EQ) { - if (auto *PR = dyn_cast<PathSensitiveBugReport>(&I)) { + BugReport *R = EQ.getReports()[0].get(); + for (auto &J : EQ.getReports()) { + if (auto *PR = dyn_cast<PathSensitiveBugReport>(J.get())) { R = PR; bugReports.push_back(PR); } @@ -2824,8 +2822,8 @@ BugReport *PathSensitiveBugReporter::findReportInEquivalenceClass( // stack for very long paths. BugReport *exampleReport = nullptr; - for (; I != E; ++I) { - auto *R = dyn_cast<PathSensitiveBugReport>(&*I); + for (const auto &I: EQ.getReports()) { + auto *R = dyn_cast<PathSensitiveBugReport>(I.get()); if (!R) continue; |

