From 380df93fd642693c5c8ef78a2c0b266405152179 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Sat, 31 May 2008 20:11:04 +0000 Subject: Added "InitializeTU" to ASTConsumer. This is used by Sema::ParseAST to pass a TranslationUnit object instead of an ASTContext. By default it calls Initialize(ASTConstext& Context) (to match with the current interface used by most ASTConsumers). Modified the ObjC-Rewriter to use InitializeTU, and to tell the TranslationUnit to not free its Decls. This is a workaround for: llvm-svn: 51825 --- clang/lib/AST/ASTConsumer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/AST/ASTConsumer.cpp') diff --git a/clang/lib/AST/ASTConsumer.cpp b/clang/lib/AST/ASTConsumer.cpp index b3d12710927..3f92990f360 100644 --- a/clang/lib/AST/ASTConsumer.cpp +++ b/clang/lib/AST/ASTConsumer.cpp @@ -13,6 +13,8 @@ #include "clang/AST/ASTConsumer.h" #include "clang/AST/Decl.h" +#include "clang/AST/TranslationUnit.h" + using namespace clang; ASTConsumer::~ASTConsumer() {} @@ -26,3 +28,7 @@ void ASTConsumer::HandleTopLevelDeclaration(Decl* d) { else HandleTopLevelDecl(d); } + +void ASTConsumer::InitializeTU(TranslationUnit& TU) { + Initialize(TU.getContext()); +} -- cgit v1.2.3