From 09c1b3d8585337c75d0a84176d0ab6f4c26a64e0 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Mon, 14 Nov 2011 04:52:24 +0000 Subject: [PCH] In ASTWriter::WriteChainedObjCCategories use getDeclID since the decls should have been already emitted. llvm-svn: 144519 --- clang/lib/Serialization/ASTWriter.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'clang/lib/Serialization/ASTWriter.cpp') diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 667b3a58ddc..8f79fa4c492 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/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); } -- cgit v1.2.3