diff options
Diffstat (limited to 'lib/Checker/BugReporter.cpp')
| -rw-r--r-- | lib/Checker/BugReporter.cpp | 19 | 
1 files changed, 19 insertions, 0 deletions
| diff --git a/lib/Checker/BugReporter.cpp b/lib/Checker/BugReporter.cpp index 0cf593b260093..7272b348581b2 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: | 
