aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/PathSensitive/ExplodedGraph.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Analysis/PathSensitive/ExplodedGraph.h')
-rw-r--r--include/clang/Analysis/PathSensitive/ExplodedGraph.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/clang/Analysis/PathSensitive/ExplodedGraph.h b/include/clang/Analysis/PathSensitive/ExplodedGraph.h
index b6e31b9ffe..16dff25037 100644
--- a/include/clang/Analysis/PathSensitive/ExplodedGraph.h
+++ b/include/clang/Analysis/PathSensitive/ExplodedGraph.h
@@ -234,6 +234,9 @@ protected:
/// Ctx - The ASTContext used to "interpret" FD.
ASTContext& Ctx;
+
+ /// NumNodes - The number of nodes in the graph.
+ unsigned NumNodes;
/// getNodeImpl - Retrieve the node associated with a (Location,State)
/// pair, where 'State' is represented as an opaque void*. This method
@@ -255,7 +258,7 @@ protected:
// ctor.
ExplodedGraphImpl(CFG& c, FunctionDecl& f, ASTContext& ctx)
- : cfg(c), FD(f), Ctx(ctx) {}
+ : cfg(c), FD(f), Ctx(ctx), NumNodes(0) {}
public:
virtual ~ExplodedGraphImpl();
@@ -263,6 +266,9 @@ public:
unsigned num_roots() const { return Roots.size(); }
unsigned num_eops() const { return EndNodes.size(); }
+ bool empty() const { return NumNodes == 0; }
+ unsigned size() const { return NumNodes; }
+
llvm::BumpPtrAllocator& getAllocator() { return Allocator; }
CFG& getCFG() { return cfg; }
ASTContext& getContext() { return Ctx; }
@@ -322,6 +328,8 @@ public:
// Insert the node into the node set and return it.
VSet->InsertNode(V, InsertPos);
+ ++NumNodes;
+
if (IsNew) *IsNew = true;
}
else