diff options
author | Tom Care <tcare@apple.com> | 2010-08-03 01:55:07 +0000 |
---|---|---|
committer | Tom Care <tcare@apple.com> | 2010-08-03 01:55:07 +0000 |
commit | bc42c533e7d3d946704a49e242939dd232f33072 (patch) | |
tree | 509b1748caa4a371cf09df68e018dacb0a5ad09b /lib | |
parent | 9b823e8e1ccb8a2cb49923bad22a80ca96f41f92 (diff) |
Changed GRExprEngine to pass down a reference to itself when checkers are doing postanalysis. This allows the checker to gather information about the state of the engine when it has finished.
- Exposed the worklist and BlockAborted flag in GRCoreEngine
- Changed postanalysis checkers to use the new infrastructure
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Checker/GRExprEngine.cpp | 2 | ||||
-rw-r--r-- | lib/Checker/IdempotentOperationChecker.cpp | 7 | ||||
-rw-r--r-- | lib/Checker/UnreachableCodeChecker.cpp | 9 |
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp index 9ee723eb7c..328dacfe90 100644 --- a/lib/Checker/GRExprEngine.cpp +++ b/lib/Checker/GRExprEngine.cpp @@ -518,7 +518,7 @@ const GRState *GRExprEngine::ProcessAssume(const GRState *state, SVal cond, void GRExprEngine::ProcessEndWorklist(bool hasWorkRemaining) { for (CheckersOrdered::iterator I = Checkers.begin(), E = Checkers.end(); I != E; ++I) { - I->second->VisitEndAnalysis(G, BR, hasWorkRemaining); + I->second->VisitEndAnalysis(G, BR, *this); } } diff --git a/lib/Checker/IdempotentOperationChecker.cpp b/lib/Checker/IdempotentOperationChecker.cpp index 267e747928..26b018e54b 100644 --- a/lib/Checker/IdempotentOperationChecker.cpp +++ b/lib/Checker/IdempotentOperationChecker.cpp @@ -65,8 +65,7 @@ class IdempotentOperationChecker public: static void *getTag(); void PreVisitBinaryOperator(CheckerContext &C, const BinaryOperator *B); - void VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, - bool hasWorkRemaining); + void VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, GRExprEngine &Eng); private: // Our assumption about a particular operation. @@ -293,9 +292,9 @@ void IdempotentOperationChecker::PreVisitBinaryOperator( void IdempotentOperationChecker::VisitEndAnalysis(ExplodedGraph &G, BugReporter &BR, - bool hasWorkRemaining) { + GRExprEngine &Eng) { // If there is any work remaining we cannot be 100% sure about our warnings - if (hasWorkRemaining) + if (Eng.hasWorkRemaining()) return; // Iterate over the hash to see if we have any paths with definite diff --git a/lib/Checker/UnreachableCodeChecker.cpp b/lib/Checker/UnreachableCodeChecker.cpp index e95e6a832d..e3d758f20a 100644 --- a/lib/Checker/UnreachableCodeChecker.cpp +++ b/lib/Checker/UnreachableCodeChecker.cpp @@ -33,8 +33,9 @@ namespace { class UnreachableCodeChecker : public CheckerVisitor<UnreachableCodeChecker> { public: static void *getTag(); - void VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, - bool hasWorkRemaining); + void VisitEndAnalysis(ExplodedGraph &G, + BugReporter &B, + GRExprEngine &Eng); private: typedef bool (*ExplodedNodeHeuristic)(const ExplodedNode &EN); @@ -60,9 +61,9 @@ void clang::RegisterUnreachableCodeChecker(GRExprEngine &Eng) { void UnreachableCodeChecker::VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, - bool hasWorkRemaining) { + GRExprEngine &Eng) { // Bail out if we didn't cover all paths - if (hasWorkRemaining) + if (Eng.hasWorkRemaining()) return; CFG *C = 0; |