[PATCH] D18860: [analyzer] Fix the "Zombie symbols" issue.

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 30 16:58:27 PDT 2018


george.karpenkov requested changes to this revision.
george.karpenkov added a comment.
This revision now requires changes to proceed.
Herald added a subscriber: baloghadamsoftware.

The change LGTM after nits and rebasing IF the new evaluation will not show a too large regression.



================
Comment at: lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp:3925
   // Update counts from autorelease pools
-  for (SymbolReaper::dead_iterator I = SymReaper.dead_begin(),
-       E = SymReaper.dead_end(); I != E; ++I) {
-    SymbolRef Sym = *I;
-    if (const RefVal *T = B.lookup(Sym)){
+  for (auto I = B.begin(), E = B.end(); I != E; ++I) {
+    SymbolRef Sym = I->first;
----------------
for .. in loop?


================
Comment at: lib/StaticAnalyzer/Checkers/StreamChecker.cpp:402
+  const StreamMapTy &Map = state->get<StreamMap>();
+  for (auto I = Map.begin(), E = Map.end(); I != E; ++I) {
+    SymbolRef Sym = I->first;
----------------
foreach loop?


https://reviews.llvm.org/D18860





More information about the cfe-commits mailing list