Add an overridable MatchCallback::onEndOfTranslationUnit() function.

Differential Revision: http://llvm-reviews.chandlerc.com/D745

llvm-svn: 182798
diff --git a/clang/lib/ASTMatchers/ASTMatchFinder.cpp b/clang/lib/ASTMatchers/ASTMatchFinder.cpp
index eccc9cd..378453d 100644
--- a/clang/lib/ASTMatchers/ASTMatchFinder.cpp
+++ b/clang/lib/ASTMatchers/ASTMatchFinder.cpp
@@ -278,6 +278,15 @@
     }
   }
 
+  void onEndOfTranslationUnit() {
+    for (std::vector<std::pair<const internal::DynTypedMatcher*,
+                               MatchCallback*> >::const_iterator
+             I = MatcherCallbackPairs->begin(), E = MatcherCallbackPairs->end();
+         I != E; ++I) {
+      I->second->onEndOfTranslationUnit();
+    }
+  }
+
   void set_active_ast_context(ASTContext *NewActiveASTContext) {
     ActiveASTContext = NewActiveASTContext;
   }
@@ -679,6 +688,7 @@
     Visitor.set_active_ast_context(&Context);
     Visitor.onStartOfTranslationUnit();
     Visitor.TraverseDecl(Context.getTranslationUnitDecl());
+    Visitor.onEndOfTranslationUnit();
     Visitor.set_active_ast_context(NULL);
   }