diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-02-18 23:00:23 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-02-18 23:00:23 +0000 |
commit | 39b4c6c98d391b25c376782cf92346aa88c96f7e (patch) | |
tree | 923e899419dabed9d8a353ff8538216b6182064d /include/clang/Analysis/PathSensitive/ExplodedGraph.h | |
parent | 692416c214a3b234236dedcf875735a9cc29e90b (diff) |
Added "size()" and "empty()" methods to ExplodedGraphImpl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47289 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/PathSensitive/ExplodedGraph.h')
-rw-r--r-- | include/clang/Analysis/PathSensitive/ExplodedGraph.h | 10 |
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 |