From 0cd1f88e8c906082fd9c95a82ff0928a66e88c78 Mon Sep 17 00:00:00 2001 From: George Karpenkov Date: Thu, 11 Oct 2018 22:59:38 +0000 Subject: [PATCH] [analyzer] Avoid unneeded invalidation in RetainCountChecker Differential Revision: https://reviews.llvm.org/D53168 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344312 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../RetainCountChecker/RetainCountChecker.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp b/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp index ca58f14985..1608bade7e 100644 --- a/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp @@ -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; } -- 2.40.0