[PATCH] D24278: [analyzer] Extend bug reports with extra notes.

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 9 11:46:03 PDT 2016


NoQ added a comment.

Thanks!

I could have split this up into three patches (one for the core and two patches for the checkers), however that'd mean that the first patch comes without tests; so i thought that the patch should be self-contained. Was it a bad idea after all?


================
Comment at: lib/StaticAnalyzer/Core/BugReporter.cpp:3449
@@ +3448,3 @@
+    // we may optionally convert those to path notes.
+    for (auto I = exampleReport->getExtraNotes().rbegin(),
+              E = exampleReport->getExtraNotes().rend(); I != E; ++I) {
----------------
a.sidorin wrote:
> Reverse iteration on array and push the corresponding element to the front (always O(n)) seems a bit strange to me. I suggest using a combination of resize + move existing elements to the end + copy/transform from start. What do you think? Or am I missing something?
`PathPieces` is an `std::list`, so each push is O(1).


https://reviews.llvm.org/D24278





More information about the cfe-commits mailing list