[PATCH] D53168: [analyzer] [NFC] Remove redundant block in RetainCountChecker

George Karpenkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 11 16:01:39 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL344312: [analyzer] Avoid unneeded invalidation in RetainCountChecker (authored by george.karpenkov, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D53168?vs=169298&id=169334#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D53168

Files:
  cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp


Index: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp
@@ -802,25 +802,6 @@
   }
   state = state->BindExpr(CE, LCtx, RetVal, false);
 
-  // FIXME: This should not be necessary, but otherwise the argument seems to be
-  // considered alive during the next statement.
-  if (const MemRegion *ArgRegion = RetVal.getAsRegion()) {
-    // Save the refcount status of the argument.
-    SymbolRef Sym = RetVal.getAsLocSymbol();
-    const RefVal *Binding = nullptr;
-    if (Sym)
-      Binding = getRefBinding(state, Sym);
-
-    // Invalidate the argument region.
-    state = state->invalidateRegions(
-        ArgRegion, CE, C.blockCount(), LCtx,
-        /*CausesPointerEscape*/ hasTrustedImplementationAnnotation);
-
-    // Restore the refcount status of the argument.
-    if (Binding)
-      state = setRefBinding(state, Sym, *Binding);
-  }
-
   C.addTransition(state);
   return true;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53168.169334.patch
Type: text/x-patch
Size: 1163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181011/88989a00/attachment.bin>


More information about the llvm-commits mailing list