]> granicus.if.org Git - clang/commitdiff
[analyzer] Avoid unneeded invalidation in RetainCountChecker
authorGeorge Karpenkov <ekarpenkov@apple.com>
Thu, 11 Oct 2018 22:59:38 +0000 (22:59 +0000)
committerGeorge Karpenkov <ekarpenkov@apple.com>
Thu, 11 Oct 2018 22:59:38 +0000 (22:59 +0000)
Differential Revision: https://reviews.llvm.org/D53168

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344312 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp

index ca58f14985ccbd441bda9828d8b1c528bf1fc49d..1608bade7e9a2d953350c133c931001cde15f5f4 100644 (file)
@@ -802,25 +802,6 @@ bool RetainCountChecker::evalCall(const CallExpr *CE, CheckerContext &C) const {
   }
   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;
 }