diff options
| author | Ted Kremenek <kremenek@apple.com> | 2012-03-23 06:26:56 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2012-03-23 06:26:56 +0000 |
| commit | 161046edabfaaec73b320da65b4dc48da07973cd (patch) | |
| tree | b3e6ce534252c77cdec0b25446b7d8186f3f4b58 /clang/lib/StaticAnalyzer/Core/CheckerManager.cpp | |
| parent | aefeaa9873bb8a0f997498e7b28d0d6d9742f9aa (diff) | |
| download | bcm5719-llvm-161046edabfaaec73b320da65b4dc48da07973cd.tar.gz bcm5719-llvm-161046edabfaaec73b320da65b4dc48da07973cd.zip | |
Avoid applying retain/release effects twice in RetainCountChecker when a function call was inlined (i.e., we do not need to apply summaries in such cases).
llvm-svn: 153309
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CheckerManager.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/CheckerManager.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp b/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp index 6f7a47fb8fe..e8de329dafa 100644 --- a/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp +++ b/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp @@ -138,13 +138,15 @@ namespace { const CheckersTy &Checkers; const Stmt *S; ExprEngine &Eng; + bool wasInlined; CheckersTy::const_iterator checkers_begin() { return Checkers.begin(); } CheckersTy::const_iterator checkers_end() { return Checkers.end(); } CheckStmtContext(bool isPreVisit, const CheckersTy &checkers, - const Stmt *s, ExprEngine &eng) - : IsPreVisit(isPreVisit), Checkers(checkers), S(s), Eng(eng) { } + const Stmt *s, ExprEngine &eng, bool wasInlined = false) + : IsPreVisit(isPreVisit), Checkers(checkers), S(s), Eng(eng), + wasInlined(wasInlined) {} void runChecker(CheckerManager::CheckStmtFunc checkFn, NodeBuilder &Bldr, ExplodedNode *Pred) { @@ -153,8 +155,7 @@ namespace { ProgramPoint::PostStmtKind; const ProgramPoint &L = ProgramPoint::getProgramPoint(S, K, Pred->getLocationContext(), checkFn.Checker); - CheckerContext C(Bldr, Eng, Pred, L); - + CheckerContext C(Bldr, Eng, Pred, L, wasInlined); checkFn(S, C); } }; @@ -165,9 +166,10 @@ void CheckerManager::runCheckersForStmt(bool isPreVisit, ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const Stmt *S, - ExprEngine &Eng) { + ExprEngine &Eng, + bool wasInlined) { CheckStmtContext C(isPreVisit, *getCachedStmtCheckersFor(S, isPreVisit), - S, Eng); + S, Eng, wasInlined); expandGraphWithCheckers(C, Dst, Src); } |

