]> granicus.if.org Git - clang/commitdiff
simplify away some dead ownership stuff, TranslationUnit is now
authorChris Lattner <sabre@nondot.org>
Sat, 28 Mar 2009 04:00:23 +0000 (04:00 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 28 Mar 2009 04:00:23 +0000 (04:00 +0000)
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
lib/AST/TranslationUnit.cpp

index 2b22cf98e4aa215b2b9452a404cb18bf173b7929..5ebcfa649dc43782fa94a34f2ece263193227e27 100644 (file)
@@ -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();
 
index df135edf6371d1f4d603142c8c606c77ab171914..57f9f4ebc80a32dbe165c35ad67291dd2b966ee2 100644 (file)
@@ -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,