summaryrefslogtreecommitdiff
path: root/lib/AST/ASTConsumer.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-05-31 20:11:04 +0000
committerTed Kremenek <kremenek@apple.com>2008-05-31 20:11:04 +0000
commite3a6198400453c0d9623207718e4942f7c111f87 (patch)
tree58a5df0abe91c7ace437145acce130e7b2553eb9 /lib/AST/ASTConsumer.cpp
parentbaf58c3f1fb13eec46fe339287662f180bb566da (diff)
downloadclang-e3a6198400453c0d9623207718e4942f7c111f87.tar.gz
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: <rdar://problem/5966749> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51825 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTConsumer.cpp')
-rw-r--r--lib/AST/ASTConsumer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/AST/ASTConsumer.cpp b/lib/AST/ASTConsumer.cpp
index b3d1271092..3f92990f36 100644
--- a/lib/AST/ASTConsumer.cpp
+++ b/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());
+}