[cfe-commits] r67891 - in /cfe/trunk: include/clang/AST/TranslationUnit.h lib/AST/ASTContext.cpp lib/AST/TranslationUnit.cpp tools/clang-cc/RewriteObjC.cpp

Chris Lattner sabre at nondot.org
Fri Mar 27 18:44:40 PDT 2009


Author: lattner
Date: Fri Mar 27 20:44:40 2009
New Revision: 67891

URL: http://llvm.org/viewvc/llvm-project?rev=67891&view=rev
Log:
remove TranslationUnit::OwnsDecls, which is only set, never read.

Modified:
    cfe/trunk/include/clang/AST/TranslationUnit.h
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/lib/AST/TranslationUnit.cpp
    cfe/trunk/tools/clang-cc/RewriteObjC.cpp

Modified: cfe/trunk/include/clang/AST/TranslationUnit.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TranslationUnit.h?rev=67891&r1=67890&r2=67891&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/TranslationUnit.h (original)
+++ cfe/trunk/include/clang/AST/TranslationUnit.h Fri Mar 27 20:44:40 2009
@@ -33,17 +33,13 @@
 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();
 

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=67891&r1=67890&r2=67891&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Fri Mar 27 20:44:40 2009
@@ -35,8 +35,7 @@
                        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);

Modified: cfe/trunk/lib/AST/TranslationUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TranslationUnit.cpp?rev=67891&r1=67890&r2=67891&view=diff

==============================================================================
--- cfe/trunk/lib/AST/TranslationUnit.cpp (original)
+++ cfe/trunk/lib/AST/TranslationUnit.cpp Fri Mar 27 20:44:40 2009
@@ -35,10 +35,9 @@
     // 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;
   }  
 }

Modified: cfe/trunk/tools/clang-cc/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/RewriteObjC.cpp?rev=67891&r1=67890&r2=67891&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/RewriteObjC.cpp (original)
+++ cfe/trunk/tools/clang-cc/RewriteObjC.cpp Fri Mar 27 20:44:40 2009
@@ -127,7 +127,6 @@
     virtual void Initialize(ASTContext &context);
 
     virtual void InitializeTU(TranslationUnit &TU) {
-      TU.SetOwnsDecls(false);
       Initialize(TU.getContext());
     }
     





More information about the cfe-commits mailing list