diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-02-19 23:45:28 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-02-19 23:45:28 +0000 |
commit | 513f0b147e1ac64064a04992aa287e68d8c24efc (patch) | |
tree | 68ce4880ad2eb7fdf367dab16dc277c2d2724bb3 | |
parent | 406d2c17f5d2bd3858159f22a01d514c6e364d98 (diff) | |
download | bcm5719-llvm-513f0b147e1ac64064a04992aa287e68d8c24efc.tar.gz bcm5719-llvm-513f0b147e1ac64064a04992aa287e68d8c24efc.zip |
Added a new method to GRStmtNodeBuilder to build nodes using an arbitrary
PostStmt program point. This allows clients to pass in PostStmtCustom program
points.
llvm-svn: 65080
-rw-r--r-- | clang/include/clang/Analysis/PathSensitive/GRCoreEngine.h | 7 | ||||
-rw-r--r-- | clang/lib/Analysis/GRCoreEngine.cpp | 11 |
2 files changed, 14 insertions, 4 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/GRCoreEngine.h b/clang/include/clang/Analysis/PathSensitive/GRCoreEngine.h index d656bc7cfca..5bd76a034b3 100644 --- a/clang/include/clang/Analysis/PathSensitive/GRCoreEngine.h +++ b/clang/include/clang/Analysis/PathSensitive/GRCoreEngine.h @@ -142,6 +142,9 @@ public: } ExplodedNodeImpl* + generateNodeImpl(PostStmt PP, const void* State, ExplodedNodeImpl* Pred); + + ExplodedNodeImpl* generateNodeImpl(Stmt* S, const void* State, ExplodedNodeImpl* Pred, ProgramPoint::Kind K = ProgramPoint::PostStmtKind); @@ -193,6 +196,10 @@ public: return static_cast<NodeTy*>(NB.getLastNode()); } + NodeTy* generateNode(PostStmt PP, const StateTy* St, NodeTy* Pred) { + return static_cast<NodeTy*>(NB.generateNodeImpl(PP, St, Pred)); + } + NodeTy* generateNode(Stmt* S, const StateTy* St, NodeTy* Pred, ProgramPoint::Kind K) { HasGeneratedNode = true; diff --git a/clang/lib/Analysis/GRCoreEngine.cpp b/clang/lib/Analysis/GRCoreEngine.cpp index 42ea41382eb..28f1a317c3d 100644 --- a/clang/lib/Analysis/GRCoreEngine.cpp +++ b/clang/lib/Analysis/GRCoreEngine.cpp @@ -368,7 +368,7 @@ void GRStmtNodeBuilderImpl::GenerateAutoTransition(ExplodedNodeImpl* N) { Eng.WList->Enqueue(Succ, B, Idx+1); } -static inline ProgramPoint GetPostLoc(Stmt* S, ProgramPoint::Kind K) { +static inline PostStmt GetPostLoc(Stmt* S, ProgramPoint::Kind K) { switch (K) { default: assert(false && "Invalid PostXXXKind."); @@ -403,10 +403,13 @@ ExplodedNodeImpl* GRStmtNodeBuilderImpl::generateNodeImpl(Stmt* S, const void* State, ExplodedNodeImpl* Pred, ProgramPoint::Kind K) { - + return generateNodeImpl(GetPostLoc(S, K), State, Pred); +} + +ExplodedNodeImpl* +GRStmtNodeBuilderImpl::generateNodeImpl(PostStmt Loc, const void* State, + ExplodedNodeImpl* Pred) { bool IsNew; - ProgramPoint Loc = GetPostLoc(S, K); - ExplodedNodeImpl* N = Eng.G->getNodeImpl(Loc, State, &IsNew); N->addPredecessor(Pred); Deferred.erase(Pred); |