From: Ted Kremenek Date: Tue, 29 Jan 2008 22:11:49 +0000 (+0000) Subject: Renamed GRNodeBuilder to GRStmtNodeBuilder. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4b7a6940070f04d7845ac55f0d1e300a8bee0d9;p=clang Renamed GRNodeBuilder to GRStmtNodeBuilder. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46531 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Analysis/GRConstants.cpp b/Analysis/GRConstants.cpp index e846aac451..6d89b29b61 100644 --- a/Analysis/GRConstants.cpp +++ b/Analysis/GRConstants.cpp @@ -730,7 +730,7 @@ class VISIBILITY_HIDDEN GRConstants { public: typedef ValueMapTy StateTy; - typedef GRNodeBuilder NodeBuilder; + typedef GRStmtNodeBuilder NodeBuilder; typedef ExplodedGraph GraphTy; typedef GraphTy::NodeTy NodeTy; @@ -765,7 +765,7 @@ protected: /// Expr* in the CFG. Used to prune out dead state. LiveVariables Liveness; - /// Builder - The current GRNodeBuilder which is used when building the nodes + /// Builder - The current GRStmtNodeBuilder which is used when building the nodes /// for a given statement. NodeBuilder* Builder; diff --git a/Analysis/GREngine.cpp b/Analysis/GREngine.cpp index 65cfb24fe3..6aaf0d89e1 100644 --- a/Analysis/GREngine.cpp +++ b/Analysis/GREngine.cpp @@ -139,7 +139,7 @@ void GREngineImpl::HandleBlockEntrance(const BlockEntrance& L, ExplodedNodeImpl* Pred) { if (Stmt* S = L.getFirstStmt()) { - GRNodeBuilderImpl Builder(L.getBlock(), 0, Pred, this); + GRStmtNodeBuilderImpl Builder(L.getBlock(), 0, Pred, this); ProcessStmt(S, Builder); } else @@ -167,7 +167,7 @@ void GREngineImpl::HandlePostStmt(const PostStmt& L, CFGBlock* B, if (StmtIdx == B->size()) HandleBlockExit(B, Pred); else { - GRNodeBuilderImpl Builder(B, StmtIdx, Pred, this); + GRStmtNodeBuilderImpl Builder(B, StmtIdx, Pred, this); ProcessStmt((*B)[StmtIdx], Builder); } } @@ -204,19 +204,19 @@ void GREngineImpl::GenerateNode(const ProgramPoint& Loc, void* State, if (IsNew) WList->Enqueue(GRWorkListUnit(Node)); } -GRNodeBuilderImpl::GRNodeBuilderImpl(CFGBlock* b, unsigned idx, +GRStmtNodeBuilderImpl::GRStmtNodeBuilderImpl(CFGBlock* b, unsigned idx, ExplodedNodeImpl* N, GREngineImpl* e) : Eng(*e), B(*b), Idx(idx), LastNode(N), Populated(false) { Deferred.insert(N); } -GRNodeBuilderImpl::~GRNodeBuilderImpl() { +GRStmtNodeBuilderImpl::~GRStmtNodeBuilderImpl() { for (DeferredTy::iterator I=Deferred.begin(), E=Deferred.end(); I!=E; ++I) if (!(*I)->isInfeasible()) GenerateAutoTransition(*I); } -void GRNodeBuilderImpl::GenerateAutoTransition(ExplodedNodeImpl* N) { +void GRStmtNodeBuilderImpl::GenerateAutoTransition(ExplodedNodeImpl* N) { assert (!N->isInfeasible()); PostStmt Loc(getStmt()); @@ -236,7 +236,7 @@ void GRNodeBuilderImpl::GenerateAutoTransition(ExplodedNodeImpl* N) { Eng.WList->Enqueue(Succ, B, Idx+1); } -ExplodedNodeImpl* GRNodeBuilderImpl::generateNodeImpl(Stmt* S, void* State, +ExplodedNodeImpl* GRStmtNodeBuilderImpl::generateNodeImpl(Stmt* S, void* State, ExplodedNodeImpl* Pred) { bool IsNew; diff --git a/include/clang/Analysis/PathSensitive/ExplodedGraph.h b/include/clang/Analysis/PathSensitive/ExplodedGraph.h index 9545e7c0d8..a7f6c3c005 100644 --- a/include/clang/Analysis/PathSensitive/ExplodedGraph.h +++ b/include/clang/Analysis/PathSensitive/ExplodedGraph.h @@ -28,7 +28,7 @@ namespace clang { class GREngineImpl; class ExplodedNodeImpl; -class GRNodeBuilderImpl; +class GRStmtNodeBuilderImpl; class CFG; class ASTContext; class FunctionDecl; @@ -38,7 +38,7 @@ class ExplodedNodeImpl : public llvm::FoldingSetNode { protected: friend class ExplodedGraphImpl; friend class GREngineImpl; - friend class GRNodeBuilderImpl; + friend class GRStmtNodeBuilderImpl; class NodeGroup { enum { Size1 = 0x0, SizeOther = 0x1, Infeasible = 0x2, Flags = 0x3 }; @@ -192,7 +192,7 @@ public: class ExplodedGraphImpl { protected: friend class GREngineImpl; - friend class GRNodeBuilderImpl; + friend class GRStmtNodeBuilderImpl; // Type definitions. typedef llvm::DenseMap EdgeNodeSetMap; diff --git a/include/clang/Analysis/PathSensitive/GREngine.h b/include/clang/Analysis/PathSensitive/GREngine.h index 52a323dfb6..e783d8e7d0 100644 --- a/include/clang/Analysis/PathSensitive/GREngine.h +++ b/include/clang/Analysis/PathSensitive/GREngine.h @@ -21,12 +21,12 @@ namespace clang { -class GRNodeBuilderImpl; +class GRStmtNodeBuilderImpl; class GRWorkList; class GREngineImpl { protected: - friend class GRNodeBuilderImpl; + friend class GRStmtNodeBuilderImpl; typedef llvm::DenseMap ParentMapTy; @@ -62,7 +62,7 @@ protected: virtual void* ProcessEOP(CFGBlock* Blk, void* State) = 0; - virtual void ProcessStmt(Stmt* S, GRNodeBuilderImpl& Builder) = 0; + virtual void ProcessStmt(Stmt* S, GRStmtNodeBuilderImpl& Builder) = 0; virtual void ProcessTerminator(Stmt* Terminator, CFGBlock* B, ExplodedNodeImpl* Pred) = 0; @@ -84,7 +84,7 @@ public: CFG& getCFG() { return G->getCFG(); } }; -class GRNodeBuilderImpl { +class GRStmtNodeBuilderImpl { GREngineImpl& Eng; CFGBlock& B; const unsigned Idx; @@ -98,10 +98,10 @@ class GRNodeBuilderImpl { void GenerateAutoTransition(ExplodedNodeImpl* N); public: - GRNodeBuilderImpl(CFGBlock* b, unsigned idx, + GRStmtNodeBuilderImpl(CFGBlock* b, unsigned idx, ExplodedNodeImpl* N, GREngineImpl* e); - ~GRNodeBuilderImpl(); + ~GRStmtNodeBuilderImpl(); const ExplodedGraphImpl& getGraph() const { return *Eng.G; } @@ -124,16 +124,16 @@ public: }; template -class GRNodeBuilder { +class GRStmtNodeBuilder { typedef CHECKER CheckerTy; typedef typename CheckerTy::StateTy StateTy; typedef ExplodedGraph GraphTy; typedef typename GraphTy::NodeTy NodeTy; - GRNodeBuilderImpl& NB; + GRStmtNodeBuilderImpl& NB; public: - GRNodeBuilder(GRNodeBuilderImpl& nb) : NB(nb) {} + GRStmtNodeBuilder(GRStmtNodeBuilderImpl& nb) : NB(nb) {} const GraphTy& getGraph() const { return static_cast(NB.getGraph()); @@ -177,8 +177,8 @@ protected: return State; } - virtual void ProcessStmt(Stmt* S, GRNodeBuilderImpl& BuilderImpl) { - GRNodeBuilder Builder(BuilderImpl); + virtual void ProcessStmt(Stmt* S, GRStmtNodeBuilderImpl& BuilderImpl) { + GRStmtNodeBuilder Builder(BuilderImpl); Checker->ProcessStmt(S, Builder); }