]> granicus.if.org Git - clang/commitdiff
[PCH] In ASTWriter::WriteChainedObjCCategories use getDeclID since the decls
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 14 Nov 2011 04:52:24 +0000 (04:52 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 14 Nov 2011 04:52:24 +0000 (04:52 +0000)
should have been already emitted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144519 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Serialization/ASTWriter.h
lib/Serialization/ASTWriter.cpp

index cdba3e9883a3abcd2c4db2031f0fcf45fa8c2e46..3c8ef2b1ab0ed4ba80266e4d83b7f2cb55f3ef33 100644 (file)
@@ -276,12 +276,6 @@ private:
     /// \brief The local tail category ID that got chained to the imported
     /// interface.
     const ObjCCategoryDecl *TailCategory;
-
-    /// \brief ID corresponding to \c Interface.
-    serialization::DeclID InterfaceID;
-
-    /// \brief ID corresponding to TailCategoryID.
-    serialization::DeclID TailCategoryID;
   };
   /// \brief ObjC categories that got chained to an interface imported from
   /// another module.
index 667b3a58ddc43213091f2cea83687cde7297103b..8f79fa4c49243eb7d04a7fc0e2dd5ee90978038d 100644 (file)
@@ -2992,8 +2992,7 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
     }
   }
   
-  // Resolve any declaration pointers within the declaration updates block and
-  // chained Objective-C categories block to declaration IDs.
+  // Resolve any declaration pointers within the declaration updates block.
   ResolveDeclUpdatesBlocks();
   
   // Form the record of special types.
@@ -3255,13 +3254,13 @@ void ASTWriter::WriteChainedObjCCategories() {
     if (isRewritten(Data.Interface))
       continue;
 
+    assert(Data.Interface->getCategoryList());
     serialization::DeclID
         HeadCatID = getDeclID(Data.Interface->getCategoryList());
-    assert(HeadCatID != 0 && "Category not written ?");
 
-    Record.push_back(GetDeclRef(Data.Interface));
+    Record.push_back(getDeclID(Data.Interface));
     Record.push_back(HeadCatID);
-    Record.push_back(GetDeclRef(Data.TailCategory));
+    Record.push_back(getDeclID(Data.TailCategory));
   }
   Stream.EmitRecord(OBJC_CHAINED_CATEGORIES, Record);
 }
@@ -4119,7 +4118,7 @@ void ASTWriter::AddedObjCCategoryToInterface(const ObjCCategoryDecl *CatD,
     return; // We already recorded that the tail of a category chain should be
             // attached to an interface.
 
-  ChainedObjCCategoriesData Data =  { IFD, CatD, 0, 0 };
+  ChainedObjCCategoriesData Data =  { IFD, CatD };
   LocalChainedObjCCategories.push_back(Data);
 }