summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commit912c28444f7e5da23f1474e3026747a83d6b1d02 (patch)
tree4a16ae3ab337c6423c321dd907b0a04d37fa719d /clang/lib
parent6f7c419308b095f3692dfbab4293386ff025a064 (diff)
downloadbcm5719-llvm-912c28444f7e5da23f1474e3026747a83d6b1d02.tar.gz
bcm5719-llvm-912c28444f7e5da23f1474e3026747a83d6b1d02.zip
Added "Auditor" interface for auditing the construction of ExplodedGraphs.
llvm-svn: 55403
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Analysis/ExplodedGraph.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/lib/Analysis/ExplodedGraph.cpp b/clang/lib/Analysis/ExplodedGraph.cpp
index 0835944250f..945416b1b56 100644
--- a/clang/lib/Analysis/ExplodedGraph.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud