]> granicus.if.org Git - clang/commitdiff
remove TranslationUnit::OwnsDecls, which is only set, never read.
authorChris Lattner <sabre@nondot.org>
Sat, 28 Mar 2009 01:44:40 +0000 (01:44 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 28 Mar 2009 01:44:40 +0000 (01:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67891 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/TranslationUnit.h
lib/AST/ASTContext.cpp
lib/AST/TranslationUnit.cpp
tools/clang-cc/RewriteObjC.cpp

index 9c356a20fdfc92b408ac3cdf717f2296550e5f6b..33cb47b9e5e3060ec1f0114d3824a48af91a0642 100644 (file)
@@ -33,17 +33,13 @@ class FileEntry;
 class TranslationUnit {
   ASTContext* Context;
   bool OwnsMetaData;
-  bool OwnsDecls;
 
   // The default ctor is only invoked during deserialization.
-  explicit TranslationUnit() : Context(NULL), OwnsMetaData(true),
-                               OwnsDecls(true) {}
+  explicit TranslationUnit() : Context(NULL), OwnsMetaData(true){}
   
 public:
   explicit TranslationUnit(ASTContext& Ctx)
-    : Context(&Ctx), OwnsMetaData(false), OwnsDecls(true) {}
-
-  void SetOwnsDecls(bool val) { OwnsDecls = val; }
+    : Context(&Ctx), OwnsMetaData(false) {}
 
   ~TranslationUnit();
 
index da6e049732ea96b930768c5016f20c652c424b1f..3fe6db834286c2158a6ed4d4cdb9c430b66dc4fa 100644 (file)
@@ -35,8 +35,7 @@ ASTContext::ASTContext(const LangOptions& LOpts, SourceManager &SM,
                        bool FreeMem, unsigned size_reserve) : 
   GlobalNestedNameSpecifier(0), CFConstantStringTypeDecl(0), 
   ObjCFastEnumerationStateTypeDecl(0), SourceMgr(SM), LangOpts(LOpts), 
-  FreeMemory(FreeMem), Target(t), Idents(idents), Selectors(sels)
-{  
+  FreeMemory(FreeMem), Target(t), Idents(idents), Selectors(sels) {  
   if (size_reserve > 0) Types.reserve(size_reserve);    
   InitBuiltinTypes();
   BuiltinInfo.InitializeBuiltins(idents, Target, LangOpts.NoBuiltin);
index 95cad39f6812f88ae6787d9e979cd80aa285d9ea..ed84241df423ccb7b8ab829d8fc1883d33358f30 100644 (file)
@@ -35,10 +35,9 @@ TranslationUnit::~TranslationUnit() {
     // 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->Idents;
+    delete &Context->Selectors;
+    delete &Context->Target;
     delete Context;
   }  
 }
index c3cc2c3852ae793f56200667bded36780492aafa..2ce983ca8582bf113d4a25595b9f77d3a8e4199f 100644 (file)
@@ -127,7 +127,6 @@ namespace {
     virtual void Initialize(ASTContext &context);
 
     virtual void InitializeTU(TranslationUnit &TU) {
-      TU.SetOwnsDecls(false);
       Initialize(TU.getContext());
     }