aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ExplodedGraph.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-08-27 01:56:11 +0000
committerTed Kremenek <kremenek@apple.com>2008-08-27 01:56:11 +0000
commit2e287540c90255e14208e7e5f43f07cb752a1fd7 (patch)
tree54f9790fc949923262d3fe61f0fd586c60f24ddf /lib/Analysis/ExplodedGraph.cpp
parent45b8789258b282769b03cbeb68e9f5b0308f067b (diff)
Added "Auditor" interface for auditing the construction of ExplodedGraphs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55403 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ExplodedGraph.cpp')
-rw-r--r--lib/Analysis/ExplodedGraph.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/Analysis/ExplodedGraph.cpp b/lib/Analysis/ExplodedGraph.cpp
index 0835944250..945416b1b5 100644
--- a/lib/Analysis/ExplodedGraph.cpp
+++ b/lib/Analysis/ExplodedGraph.cpp
@@ -22,6 +22,26 @@
using namespace clang;
+//===----------------------------------------------------------------------===//
+// Node auditing.
+//===----------------------------------------------------------------------===//
+
+// An out of line virtual method to provide a home for the class vtable.
+ExplodedNodeImpl::Auditor::~Auditor() {}
+
+#ifndef NDEBUG
+static ExplodedNodeImpl::Auditor* NodeAuditor = 0;
+#endif
+
+void ExplodedNodeImpl::SetAuditor(ExplodedNodeImpl::Auditor* A) {
+#ifndef NDEBUG
+ NodeAuditor = A;
+#endif
+}
+
+//===----------------------------------------------------------------------===//
+// ExplodedNodeImpl.
+//===----------------------------------------------------------------------===//
static inline std::vector<ExplodedNodeImpl*>& getVector(void* P) {
return *reinterpret_cast<std::vector<ExplodedNodeImpl*>*>(P);
@@ -31,6 +51,9 @@ void ExplodedNodeImpl::addPredecessor(ExplodedNodeImpl* V) {
assert (!V->isSink());
Preds.addNode(V);
V->Succs.addNode(this);
+#ifndef NDEBUG
+ if (NodeAuditor) NodeAuditor->AddEdge(V, this);
+#endif
}
void ExplodedNodeImpl::NodeGroup::addNode(ExplodedNodeImpl* N) {