Index: include/clang/StaticAnalyzer/Core/Checker.h =================================================================== --- include/clang/StaticAnalyzer/Core/Checker.h +++ include/clang/StaticAnalyzer/Core/Checker.h @@ -325,20 +325,13 @@ return ((const CHECKER *)checker)->checkRegionChanges(state, invalidated, Explicits, Regions, Call); } - template - static bool _wantsRegionChangeUpdate(void *checker, - ProgramStateRef state) { - return ((const CHECKER *)checker)->wantsRegionChangeUpdate(state); - } public: template static void _register(CHECKER *checker, CheckerManager &mgr) { mgr._registerForRegionChanges( CheckerManager::CheckRegionChangesFunc(checker, - _checkRegionChanges), - CheckerManager::WantsRegionChangeUpdateFunc(checker, - _wantsRegionChangeUpdate)); + _checkRegionChanges)); } }; Index: include/clang/StaticAnalyzer/Core/CheckerManager.h =================================================================== --- include/clang/StaticAnalyzer/Core/CheckerManager.h +++ include/clang/StaticAnalyzer/Core/CheckerManager.h @@ -322,9 +322,6 @@ ExprEngine &Eng, ProgramPoint::Kind K); - /// \brief True if at least one checker wants to check region changes. - bool wantsRegionChangeUpdate(ProgramStateRef state); - /// \brief Run checkers for region changes. /// /// This corresponds to the check::RegionChanges callback. @@ -452,8 +449,6 @@ const CallEvent *Call)> CheckRegionChangesFunc; - typedef CheckerFn WantsRegionChangeUpdateFunc; - typedef CheckerFn DeadSymbolsCheckers; - struct RegionChangesCheckerInfo { - CheckRegionChangesFunc CheckFn; - WantsRegionChangeUpdateFunc WantUpdateFn; - }; - std::vector RegionChangesCheckers; + std::vector RegionChangesCheckers; std::vector PointerEscapeCheckers; Index: include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h =================================================================== --- include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h +++ include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h @@ -286,10 +286,6 @@ ProgramStateRef processAssume(ProgramStateRef state, SVal cond, bool assumption) override; - /// wantsRegionChangeUpdate - Called by ProgramStateManager to determine if a - /// region change should trigger a processRegionChanges update. - bool wantsRegionChangeUpdate(ProgramStateRef state) override; - /// processRegionChanges - Called by ProgramStateManager whenever a change is made /// to the store. Used to update checkers that track region values. ProgramStateRef Index: include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h =================================================================== --- include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h +++ include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h @@ -124,10 +124,6 @@ virtual ProgramStateRef processAssume(ProgramStateRef state, SVal cond, bool assumption) = 0; - /// wantsRegionChangeUpdate - Called by ProgramStateManager to determine if a - /// region change should trigger a processRegionChanges update. - virtual bool wantsRegionChangeUpdate(ProgramStateRef state) = 0; - /// processRegionChanges - Called by ProgramStateManager whenever a change is /// made to the store. Used to update checkers that track region values. virtual ProgramStateRef Index: lib/StaticAnalyzer/Checkers/CStringChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/CStringChecker.cpp +++ lib/StaticAnalyzer/Checkers/CStringChecker.cpp @@ -62,7 +62,6 @@ void checkPreStmt(const DeclStmt *DS, CheckerContext &C) const; void checkLiveSymbols(ProgramStateRef state, SymbolReaper &SR) const; void checkDeadSymbols(SymbolReaper &SR, CheckerContext &C) const; - bool wantsRegionChangeUpdate(ProgramStateRef state) const; ProgramStateRef checkRegionChanges(ProgramStateRef state, @@ -2112,11 +2111,6 @@ C.addTransition(state); } -bool CStringChecker::wantsRegionChangeUpdate(ProgramStateRef state) const { - CStringLengthTy Entries = state->get(); - return !Entries.isEmpty(); -} - ProgramStateRef CStringChecker::checkRegionChanges(ProgramStateRef state, const InvalidatedSymbols *, Index: lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -2649,10 +2649,6 @@ ArrayRef Regions, const CallEvent *Call) const; - bool wantsRegionChangeUpdate(ProgramStateRef state) const { - return true; - } - void checkPreStmt(const ReturnStmt *S, CheckerContext &C) const; void checkReturnWithRetEffect(const ReturnStmt *S, CheckerContext &C, ExplodedNode *Pred, RetEffect RE, RefVal X, Index: lib/StaticAnalyzer/Core/CheckerManager.cpp =================================================================== --- lib/StaticAnalyzer/Core/CheckerManager.cpp +++ lib/StaticAnalyzer/Core/CheckerManager.cpp @@ -518,15 +518,6 @@ expandGraphWithCheckers(C, Dst, Src); } -/// \brief True if at least one checker wants to check region changes. -bool CheckerManager::wantsRegionChangeUpdate(ProgramStateRef state) { - for (unsigned i = 0, e = RegionChangesCheckers.size(); i != e; ++i) - if (RegionChangesCheckers[i].WantUpdateFn(state)) - return true; - - return false; -} - /// \brief Run checkers for region changes. ProgramStateRef CheckerManager::runCheckersForRegionChanges(ProgramStateRef state, @@ -539,8 +530,8 @@ // bail out. if (!state) return nullptr; - state = RegionChangesCheckers[i].CheckFn(state, invalidated, - ExplicitRegions, Regions, Call); + state = RegionChangesCheckers[i](state, invalidated, + ExplicitRegions, Regions, Call); } return state; } @@ -726,10 +717,8 @@ DeadSymbolsCheckers.push_back(checkfn); } -void CheckerManager::_registerForRegionChanges(CheckRegionChangesFunc checkfn, - WantsRegionChangeUpdateFunc wantUpdateFn) { - RegionChangesCheckerInfo info = {checkfn, wantUpdateFn}; - RegionChangesCheckers.push_back(info); +void CheckerManager::_registerForRegionChanges(CheckRegionChangesFunc checkfn) { + RegionChangesCheckers.push_back(checkfn); } void CheckerManager::_registerForPointerEscape(CheckPointerEscapeFunc checkfn){ Index: lib/StaticAnalyzer/Core/ExprEngine.cpp =================================================================== --- lib/StaticAnalyzer/Core/ExprEngine.cpp +++ lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -262,10 +262,6 @@ return getCheckerManager().runCheckersForEvalAssume(state, cond, assumption); } -bool ExprEngine::wantsRegionChangeUpdate(ProgramStateRef state) { - return getCheckerManager().wantsRegionChangeUpdate(state); -} - ProgramStateRef ExprEngine::processRegionChanges(ProgramStateRef state, const InvalidatedSymbols *invalidated,