diff options
Diffstat (limited to 'clang/lib/Checker/BugReporter.cpp')
| -rw-r--r-- | clang/lib/Checker/BugReporter.cpp | 15 | 
1 files changed, 15 insertions, 0 deletions
| diff --git a/clang/lib/Checker/BugReporter.cpp b/clang/lib/Checker/BugReporter.cpp index 0cf593b2600..f26d16120e9 100644 --- a/clang/lib/Checker/BugReporter.cpp +++ b/clang/lib/Checker/BugReporter.cpp @@ -36,6 +36,21 @@ 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)) +    return; + +  CallbacksSet.InsertNode(visitor, InsertPos); +  Callbacks = F.Add(visitor, Callbacks); +} +  //===----------------------------------------------------------------------===//  // Helper routines for walking the ExplodedGraph and fetching statements.  //===----------------------------------------------------------------------===// | 

