From c0c7bca4e5b8d12699dc93a0da49e9e4bb79671b Mon Sep 17 00:00:00 2001 From: Roman Divacky Date: Sun, 21 Mar 2010 10:50:08 +0000 Subject: Update clang to r99115. --- lib/Checker/BugReporter.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/Checker/BugReporter.cpp') diff --git a/lib/Checker/BugReporter.cpp b/lib/Checker/BugReporter.cpp index 0cf593b26009..7272b348581b 100644 --- a/lib/Checker/BugReporter.cpp +++ b/lib/Checker/BugReporter.cpp @@ -36,6 +36,23 @@ BugReporterContext::~BugReporterContext() { if ((*I)->isOwnedByReporterContext()) delete *I; } +void BugReporterContext::addVisitor(BugReporterVisitor* visitor) { + if (!visitor) + return; + + llvm::FoldingSetNodeID ID; + visitor->Profile(ID); + void *InsertPos; + + if (CallbacksSet.FindNodeOrInsertPos(ID, InsertPos)) { + delete visitor; + return; + } + + CallbacksSet.InsertNode(visitor, InsertPos); + Callbacks = F.Add(visitor, Callbacks); +} + //===----------------------------------------------------------------------===// // Helper routines for walking the ExplodedGraph and fetching statements. //===----------------------------------------------------------------------===// @@ -1613,7 +1630,9 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, else return; + // Register node visitors. R->registerInitialVisitors(PDB, N); + bugreporter::registerNilReceiverVisitor(PDB); switch (PDB.getGenerationScheme()) { case PathDiagnosticClient::Extensive: -- cgit v1.3