public:
typedef ValueMapTy StateTy;
- typedef GRNodeBuilder<GRConstants> NodeBuilder;
+ typedef GRStmtNodeBuilder<GRConstants> NodeBuilder;
typedef ExplodedGraph<GRConstants> GraphTy;
typedef GraphTy::NodeTy NodeTy;
/// 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;
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
if (StmtIdx == B->size())
HandleBlockExit(B, Pred);
else {
- GRNodeBuilderImpl Builder(B, StmtIdx, Pred, this);
+ GRStmtNodeBuilderImpl Builder(B, StmtIdx, Pred, this);
ProcessStmt((*B)[StmtIdx], Builder);
}
}
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());
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;
class GREngineImpl;
class ExplodedNodeImpl;
-class GRNodeBuilderImpl;
+class GRStmtNodeBuilderImpl;
class CFG;
class ASTContext;
class FunctionDecl;
protected:
friend class ExplodedGraphImpl;
friend class GREngineImpl;
- friend class GRNodeBuilderImpl;
+ friend class GRStmtNodeBuilderImpl;
class NodeGroup {
enum { Size1 = 0x0, SizeOther = 0x1, Infeasible = 0x2, Flags = 0x3 };
class ExplodedGraphImpl {
protected:
friend class GREngineImpl;
- friend class GRNodeBuilderImpl;
+ friend class GRStmtNodeBuilderImpl;
// Type definitions.
typedef llvm::DenseMap<ProgramPoint,void*> EdgeNodeSetMap;
namespace clang {
-class GRNodeBuilderImpl;
+class GRStmtNodeBuilderImpl;
class GRWorkList;
class GREngineImpl {
protected:
- friend class GRNodeBuilderImpl;
+ friend class GRStmtNodeBuilderImpl;
typedef llvm::DenseMap<Stmt*,Stmt*> ParentMapTy;
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;
CFG& getCFG() { return G->getCFG(); }
};
-class GRNodeBuilderImpl {
+class GRStmtNodeBuilderImpl {
GREngineImpl& Eng;
CFGBlock& B;
const unsigned Idx;
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; }
};
template<typename CHECKER>
-class GRNodeBuilder {
+class GRStmtNodeBuilder {
typedef CHECKER CheckerTy;
typedef typename CheckerTy::StateTy StateTy;
typedef ExplodedGraph<CheckerTy> 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<const GraphTy&>(NB.getGraph());
return State;
}
- virtual void ProcessStmt(Stmt* S, GRNodeBuilderImpl& BuilderImpl) {
- GRNodeBuilder<CHECKER> Builder(BuilderImpl);
+ virtual void ProcessStmt(Stmt* S, GRStmtNodeBuilderImpl& BuilderImpl) {
+ GRStmtNodeBuilder<CHECKER> Builder(BuilderImpl);
Checker->ProcessStmt(S, Builder);
}