diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-28 04:00:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-28 04:00:23 +0000 |
commit | d070278ec9378fb87d99e0043cdc99c4c45a115e (patch) | |
tree | d580cfe11a6917125ef43e252d20b4ca609d6f1d | |
parent | edf7eb77cf4e06460f818d1f30368643d1cc32bc (diff) | |
download | bcm5719-llvm-d070278ec9378fb87d99e0043cdc99c4c45a115e.tar.gz bcm5719-llvm-d070278ec9378fb87d99e0043cdc99c4c45a115e.zip |
simplify away some dead ownership stuff, TranslationUnit is now
just a wrapper around ASTContext.
llvm-svn: 67906
-rw-r--r-- | clang/include/clang/AST/TranslationUnit.h | 5 | ||||
-rw-r--r-- | clang/lib/AST/TranslationUnit.cpp | 9 |
2 files changed, 2 insertions, 12 deletions
diff --git a/clang/include/clang/AST/TranslationUnit.h b/clang/include/clang/AST/TranslationUnit.h index 2b22cf98e4a..5ebcfa649dc 100644 --- a/clang/include/clang/AST/TranslationUnit.h +++ b/clang/include/clang/AST/TranslationUnit.h @@ -32,14 +32,13 @@ class FileEntry; class TranslationUnit { ASTContext* Context; - bool OwnsMetaData; // The default ctor is only invoked during deserialization. - explicit TranslationUnit() : Context(NULL), OwnsMetaData(true){} + explicit TranslationUnit() : Context(NULL) {} public: explicit TranslationUnit(ASTContext& Ctx) - : Context(&Ctx), OwnsMetaData(false) {} + : Context(&Ctx){} ~TranslationUnit(); diff --git a/clang/lib/AST/TranslationUnit.cpp b/clang/lib/AST/TranslationUnit.cpp index df135edf637..57f9f4ebc80 100644 --- a/clang/lib/AST/TranslationUnit.cpp +++ b/clang/lib/AST/TranslationUnit.cpp @@ -28,15 +28,6 @@ using namespace clang; TranslationUnit::~TranslationUnit() { - if (OwnsMetaData && Context) { - // The ASTContext object has the sole references to the IdentifierTable - // Selectors, and the Target information. Go and delete them, since - // the TranslationUnit effectively owns them. - delete &Context->Idents; - delete &Context->Selectors; - delete &Context->Target; - delete Context; - } } bool clang::EmitASTBitcodeBuffer(const ASTContext &Ctx, |