From 3776d4cea4f15e04f32997742deb4b35b72c9b8c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 28 Mar 2009 04:00:23 +0000 Subject: [PATCH] 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 --- include/clang/AST/TranslationUnit.h | 5 ++--- 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, -- 2.40.0