[cfe-commits] r53042 - in /cfe/trunk: include/clang/AST/ASTConsumer.h lib/Sema/ParseAST.cpp

Ted Kremenek kremenek at apple.com
Wed Jul 2 11:32:45 PDT 2008


Author: kremenek
Date: Wed Jul  2 13:32:45 2008
New Revision: 53042

URL: http://llvm.org/viewvc/llvm-project?rev=53042&view=rev
Log:
Added method "HandleTranslationUnit" to ASTConsumer.  This is called by ParseAST when all of the ASTs in a translation unit have been built.

Modified:
    cfe/trunk/include/clang/AST/ASTConsumer.h
    cfe/trunk/lib/Sema/ParseAST.cpp

Modified: cfe/trunk/include/clang/AST/ASTConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTConsumer.h?rev=53042&r1=53041&r2=53042&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/ASTConsumer.h (original)
+++ cfe/trunk/include/clang/AST/ASTConsumer.h Wed Jul  2 13:32:45 2008
@@ -37,7 +37,10 @@
   /// HandleTopLevelDecl - Handle the specified top-level declaration.  This is
   ///  called by HandleTopLevelDeclaration to process every top-level Decl*.
   virtual void HandleTopLevelDecl(Decl *D) {}
-    
+  
+  /// HandleTranslationUnit - This method is called when the ASTs for entire
+  ///  translation unit have been parsed.
+  virtual void HandleTranslationUnit(TranslationUnit& TU) {}    
   
   /// HandleTopLevelDeclaration - Handle the specified top-level declaration.
   ///  This is called only for Decl* that are the head of a chain of

Modified: cfe/trunk/lib/Sema/ParseAST.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/ParseAST.cpp?rev=53042&r1=53041&r2=53042&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/ParseAST.cpp (original)
+++ cfe/trunk/lib/Sema/ParseAST.cpp Wed Jul  2 13:32:45 2008
@@ -63,6 +63,8 @@
       Consumer->HandleTopLevelDecl(D);
     }
   };
+  
+  Consumer->HandleTranslationUnit(TU);
 
   if (PrintStats) {
     fprintf(stderr, "\nSTATISTICS:\n");





More information about the cfe-commits mailing list