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 | 3776d4cea4f15e04f32997742deb4b35b72c9b8c (patch) | |
tree | 9f1e8a83495150633b91d96526882d0b790ed101 | |
parent | d2fa67570b363843215f62395b795c1f70e6b85f (diff) |
simplify away some dead ownership stuff, TranslationUnit is now
just a wrapper around ASTContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67906 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/TranslationUnit.h | 5 | ||||
-rw-r--r-- | lib/AST/TranslationUnit.cpp | 9 |
2 files changed, 2 insertions, 12 deletions
diff --git a/include/clang/AST/TranslationUnit.h b/include/clang/AST/TranslationUnit.h index 2b22cf98e4..5ebcfa649d 100644 --- a/include/clang/AST/TranslationUnit.h +++ b/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/lib/AST/TranslationUnit.cpp b/lib/AST/TranslationUnit.cpp index df135edf63..57f9f4ebc8 100644 --- a/lib/AST/TranslationUnit.cpp +++ b/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, |