diff options
| author | Anna Zaks <ganna@apple.com> | 2013-01-03 00:25:29 +0000 |
|---|---|---|
| committer | Anna Zaks <ganna@apple.com> | 2013-01-03 00:25:29 +0000 |
| commit | 3fdcc0bda3c486c371159acdbc370933860dbe42 (patch) | |
| tree | 1c3f35704799941278f8b90df361f6c592b8107c /clang | |
| parent | 8258705dbd848afca8f56cd65adc9118be1cf35b (diff) | |
| download | bcm5719-llvm-3fdcc0bda3c486c371159acdbc370933860dbe42.tar.gz bcm5719-llvm-3fdcc0bda3c486c371159acdbc370933860dbe42.zip | |
[analyzer] Rename callback EndPath -> EndFunction
This better reflects when callback is called and what the checkers
are relying on. (Both names meant the same pre-IPA.)
llvm-svn: 171432
Diffstat (limited to 'clang')
10 files changed, 43 insertions, 43 deletions
diff --git a/clang/include/clang/StaticAnalyzer/Core/Checker.h b/clang/include/clang/StaticAnalyzer/Core/Checker.h index 61c1884544f..710bbc0d994 100644 --- a/clang/include/clang/StaticAnalyzer/Core/Checker.h +++ b/clang/include/clang/StaticAnalyzer/Core/Checker.h @@ -227,18 +227,18 @@ public: } }; -class EndPath { +class EndFunction { template <typename CHECKER> - static void _checkEndPath(void *checker, - CheckerContext &C) { - ((const CHECKER *)checker)->checkEndPath(C); + static void _checkEndFunction(void *checker, + CheckerContext &C) { + ((const CHECKER *)checker)->checkEndFunction(C); } public: template <typename CHECKER> static void _register(CHECKER *checker, CheckerManager &mgr) { - mgr._registerForEndPath( - CheckerManager::CheckEndPathFunc(checker, _checkEndPath<CHECKER>)); + mgr._registerForEndFunction( + CheckerManager::CheckEndFunctionFunc(checker, _checkEndFunction<CHECKER>)); } }; diff --git a/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h b/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h index 12de1082a9b..2fd71dd904b 100644 --- a/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h +++ b/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h @@ -264,11 +264,11 @@ public: void runCheckersForEndAnalysis(ExplodedGraph &G, BugReporter &BR, ExprEngine &Eng); - /// \brief Run checkers for end of path. - void runCheckersForEndPath(NodeBuilderContext &BC, - ExplodedNodeSet &Dst, - ExplodedNode *Pred, - ExprEngine &Eng); + /// \brief Run checkers on end of function. + void runCheckersForEndFunction(NodeBuilderContext &BC, + ExplodedNodeSet &Dst, + ExplodedNode *Pred, + ExprEngine &Eng); /// \brief Run checkers for branch condition. void runCheckersForBranchCondition(const Stmt *condition, @@ -399,7 +399,7 @@ public: CheckEndAnalysisFunc; typedef CheckerFn<void (CheckerContext &)> - CheckEndPathFunc; + CheckEndFunctionFunc; typedef CheckerFn<void (const Stmt *, CheckerContext &)> CheckBranchConditionFunc; @@ -452,7 +452,7 @@ public: void _registerForEndAnalysis(CheckEndAnalysisFunc checkfn); - void _registerForEndPath(CheckEndPathFunc checkfn); + void _registerForEndFunction(CheckEndFunctionFunc checkfn); void _registerForBranchCondition(CheckBranchConditionFunc checkfn); @@ -576,7 +576,7 @@ private: std::vector<CheckEndAnalysisFunc> EndAnalysisCheckers; - std::vector<CheckEndPathFunc> EndPathCheckers; + std::vector<CheckEndFunctionFunc> EndFunctionCheckers; std::vector<CheckBranchConditionFunc> BranchConditionCheckers; diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h index df3f45f63fc..8c3ecc1eee2 100644 --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h @@ -230,8 +230,8 @@ public: /// nodes by processing the 'effects' of a switch statement. void processSwitch(SwitchNodeBuilder& builder); - /// ProcessEndPath - Called by CoreEngine. Used to generate end-of-path - /// nodes when the control reaches the end of a function. + /// Called by CoreEngine. Used to generate end-of-path + /// nodes when the control reaches the end of a function. void processEndOfFunction(NodeBuilderContext& BC, ExplodedNode *Pred); diff --git a/clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp b/clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp index a6e0931abd0..35baef645b1 100644 --- a/clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp @@ -44,7 +44,7 @@ class CheckerDocumentation : public Checker< check::PreStmt<ReturnStmt>, check::Location, check::Bind, check::DeadSymbols, - check::EndPath, + check::EndFunction, check::EndAnalysis, check::EndOfTranslationUnit, eval::Call, @@ -153,11 +153,11 @@ public: /// check::DeadSymbols void checkDeadSymbols(SymbolReaper &SR, CheckerContext &C) const {} - /// \brief Called when the analyzer core reaches the end of the top-level + /// \brief Called when the analyzer core reaches the end of a /// function being analyzed. /// - /// check::EndPath - void checkEndPath(CheckerContext &Ctx) const {} + /// check::EndFunction + void checkEndFunction(CheckerContext &Ctx) const {} /// \brief Called after all the paths in the ExplodedGraph reach end of path /// - the symbolic execution graph is fully explored. diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index 150b4be34cc..02f8c25df48 100644 --- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -2352,7 +2352,7 @@ class RetainCountChecker : public Checker< check::Bind, check::DeadSymbols, check::EndAnalysis, - check::EndPath, + check::EndFunction, check::PostStmt<BlockExpr>, check::PostStmt<CastExpr>, check::PostStmt<ObjCArrayLiteral>, @@ -2529,7 +2529,7 @@ public: SymbolRef Sym, ProgramStateRef state) const; void checkDeadSymbols(SymbolReaper &SymReaper, CheckerContext &C) const; - void checkEndPath(CheckerContext &C) const; + void checkEndFunction(CheckerContext &C) const; ProgramStateRef updateSymbol(ProgramStateRef state, SymbolRef sym, RefVal V, ArgEffect E, RefVal::Kind &hasErr, @@ -3580,7 +3580,7 @@ RetainCountChecker::processLeaks(ProgramStateRef state, return N; } -void RetainCountChecker::checkEndPath(CheckerContext &Ctx) const { +void RetainCountChecker::checkEndFunction(CheckerContext &Ctx) const { ProgramStateRef state = Ctx.getState(); RefBindingsTy B = state->get<RefBindings>(); ExplodedNode *Pred = Ctx.getPredecessor(); diff --git a/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp index 99e98df3d84..16fc67d5fae 100644 --- a/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp @@ -27,13 +27,13 @@ using namespace ento; namespace { class StackAddrEscapeChecker : public Checker< check::PreStmt<ReturnStmt>, - check::EndPath > { + check::EndFunction > { mutable OwningPtr<BuiltinBug> BT_stackleak; mutable OwningPtr<BuiltinBug> BT_returnstack; public: void checkPreStmt(const ReturnStmt *RS, CheckerContext &C) const; - void checkEndPath(CheckerContext &Ctx) const; + void checkEndFunction(CheckerContext &Ctx) const; private: void EmitStackError(CheckerContext &C, const MemRegion *R, const Expr *RetE) const; @@ -157,7 +157,7 @@ void StackAddrEscapeChecker::checkPreStmt(const ReturnStmt *RS, EmitStackError(C, R, RetE); } -void StackAddrEscapeChecker::checkEndPath(CheckerContext &Ctx) const { +void StackAddrEscapeChecker::checkEndFunction(CheckerContext &Ctx) const { ProgramStateRef state = Ctx.getState(); // Iterate over all bindings to global variables and see if it contains diff --git a/clang/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp index cc2df72f1c3..8b242404b33 100644 --- a/clang/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp @@ -25,10 +25,10 @@ using namespace ento; namespace { class TraversalDumper : public Checker< check::BranchCondition, - check::EndPath > { + check::EndFunction > { public: void checkBranchCondition(const Stmt *Condition, CheckerContext &C) const; - void checkEndPath(CheckerContext &C) const; + void checkEndFunction(CheckerContext &C) const; }; } @@ -50,8 +50,8 @@ void TraversalDumper::checkBranchCondition(const Stmt *Condition, << Parent->getStmtClassName() << "\n"; } -void TraversalDumper::checkEndPath(CheckerContext &C) const { - llvm::outs() << "--END PATH--\n"; +void TraversalDumper::checkEndFunction(CheckerContext &C) const { + llvm::outs() << "--END FUNCTION--\n"; } void ento::registerTraversalDumper(CheckerManager &mgr) { diff --git a/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp b/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp index 9591f0cd2ec..dc0cab72f91 100644 --- a/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp +++ b/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp @@ -30,7 +30,7 @@ bool CheckerManager::hasPathSensitiveCheckers() const { !LocationCheckers.empty() || !BindCheckers.empty() || !EndAnalysisCheckers.empty() || - !EndPathCheckers.empty() || + !EndFunctionCheckers.empty() || !BranchConditionCheckers.empty() || !LiveSymbolsCheckers.empty() || !DeadSymbolsCheckers.empty() || @@ -353,17 +353,17 @@ void CheckerManager::runCheckersForEndAnalysis(ExplodedGraph &G, /// \brief Run checkers for end of path. // Note, We do not chain the checker output (like in expandGraphWithCheckers) // for this callback since end of path nodes are expected to be final. -void CheckerManager::runCheckersForEndPath(NodeBuilderContext &BC, - ExplodedNodeSet &Dst, - ExplodedNode *Pred, - ExprEngine &Eng) { +void CheckerManager::runCheckersForEndFunction(NodeBuilderContext &BC, + ExplodedNodeSet &Dst, + ExplodedNode *Pred, + ExprEngine &Eng) { // We define the builder outside of the loop bacause if at least one checkers // creates a sucsessor for Pred, we do not need to generate an // autotransition for it. NodeBuilder Bldr(Pred, Dst, BC); - for (unsigned i = 0, e = EndPathCheckers.size(); i != e; ++i) { - CheckEndPathFunc checkFn = EndPathCheckers[i]; + for (unsigned i = 0, e = EndFunctionCheckers.size(); i != e; ++i) { + CheckEndFunctionFunc checkFn = EndFunctionCheckers[i]; const ProgramPoint &L = BlockEntrance(BC.Block, Pred->getLocationContext(), @@ -633,8 +633,8 @@ void CheckerManager::_registerForEndAnalysis(CheckEndAnalysisFunc checkfn) { EndAnalysisCheckers.push_back(checkfn); } -void CheckerManager::_registerForEndPath(CheckEndPathFunc checkfn) { - EndPathCheckers.push_back(checkfn); +void CheckerManager::_registerForEndFunction(CheckEndFunctionFunc checkfn) { + EndFunctionCheckers.push_back(checkfn); } void CheckerManager::_registerForBranchCondition( diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index 2e2f00ddc4d..9c611cb9825 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -1337,10 +1337,10 @@ void ExprEngine::processEndOfFunction(NodeBuilderContext& BC, // Notify checkers. for (ExplodedNodeSet::iterator I = AfterRemovedDead.begin(), E = AfterRemovedDead.end(); I != E; ++I) { - getCheckerManager().runCheckersForEndPath(BC, Dst, *I, *this); + getCheckerManager().runCheckersForEndFunction(BC, Dst, *I, *this); } } else { - getCheckerManager().runCheckersForEndPath(BC, Dst, Pred, *this); + getCheckerManager().runCheckersForEndFunction(BC, Dst, Pred, *this); } Engine.enqueueEndOfFunction(Dst); diff --git a/clang/test/Analysis/traversal-path-unification.c b/clang/test/Analysis/traversal-path-unification.c index f53d2ff9fec..83e3b87c2bb 100644 --- a/clang/test/Analysis/traversal-path-unification.c +++ b/clang/test/Analysis/traversal-path-unification.c @@ -24,5 +24,5 @@ void testRemoveDeadBindings() { c(); } -// CHECK: --END PATH-- -// CHECK-NOT: --END PATH--
\ No newline at end of file +// CHECK: --END FUNCTION-- +// CHECK-NOT: --END FUNCTION-- |

