summaryrefslogtreecommitdiffstats
path: root/clang/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
commit380df93fd642693c5c8ef78a2c0b266405152179 (patch)
treeacb41b8a4032af7bec1a34f3cedf894c5721e432 /clang/lib/AST/ASTConsumer.cpp
parentc5156a932e581c1d1c1401a59d157e470cdf6ea1 (diff)
downloadbcm5719-llvm-380df93fd642693c5c8ef78a2c0b266405152179.tar.gz
bcm5719-llvm-380df93fd642693c5c8ef78a2c0b266405152179.zip
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> llvm-svn: 51825
Diffstat (limited to 'clang/lib/AST/ASTConsumer.cpp')
-rw-r--r--clang/lib/AST/ASTConsumer.cpp6
1 files changed, 6 insertions, 0 deletions
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());
+}
OpenPOWER on IntegriCloud