From: Argyrios Kyrtzidis Date: Mon, 14 Nov 2011 04:52:24 +0000 (+0000) Subject: [PCH] In ASTWriter::WriteChainedObjCCategories use getDeclID since the decls X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67bc4ba9894506c461aeff11302c2d2471b82273;p=clang [PCH] In ASTWriter::WriteChainedObjCCategories use getDeclID since the decls should have been already emitted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144519 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Serialization/ASTWriter.h b/include/clang/Serialization/ASTWriter.h index cdba3e9883..3c8ef2b1ab 100644 --- a/include/clang/Serialization/ASTWriter.h +++ b/include/clang/Serialization/ASTWriter.h @@ -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. diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 667b3a58dd..8f79fa4c49 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -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); }