]> granicus.if.org Git - clang/commitdiff
PCH support for categories in Objective-C interfaces.
authorDouglas Gregor <dgregor@apple.com>
Thu, 23 Apr 2009 22:34:55 +0000 (22:34 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 23 Apr 2009 22:34:55 +0000 (22:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69933 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/PCHReader.cpp
lib/Frontend/PCHWriter.cpp

index 2caab328d9a8b9827047e3de660b57adaa1736d5..eef1029724fc4dbb0f1e0ed841f66bd50e8ccf45 100644 (file)
@@ -239,13 +239,13 @@ void PCHDeclReader::VisitObjCInterfaceDecl(ObjCInterfaceDecl *ID) {
   for (unsigned I = 0; I != NumIvars; ++I)
     IVars.push_back(cast<ObjCIvarDecl>(Reader.GetDecl(Record[Idx++])));
   ID->setIVarList(&IVars[0], NumIvars, Reader.getContext());
-
+  ID->setCategoryList(
+               cast_or_null<ObjCCategoryDecl>(Reader.GetDecl(Record[Idx++])));
   ID->setForwardDecl(Record[Idx++]);
   ID->setImplicitInterfaceDecl(Record[Idx++]);
   ID->setClassLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
   ID->setSuperClassLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
   ID->setAtEndLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
-  // FIXME: add categories.
 }
 
 void PCHDeclReader::VisitObjCIvarDecl(ObjCIvarDecl *IVD) {
index 9a60625d1f06c09c34c0ceb273a6135944b7059e..11302d136ed636c0bb17c00b8fa441148a58160f 100644 (file)
@@ -415,12 +415,12 @@ void PCHDeclWriter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) {
   for (ObjCInterfaceDecl::ivar_iterator I = D->ivar_begin(), 
                                      IEnd = D->ivar_end(); I != IEnd; ++I)
     Writer.AddDeclRef(*I, Record);
+  Writer.AddDeclRef(D->getCategoryList(), Record);
   Record.push_back(D->isForwardDecl());
   Record.push_back(D->isImplicitInterfaceDecl());
   Writer.AddSourceLocation(D->getClassLoc(), Record);
   Writer.AddSourceLocation(D->getSuperClassLoc(), Record);
   Writer.AddSourceLocation(D->getLocEnd(), Record);
-  // FIXME: add categories.
   Code = pch::DECL_OBJC_INTERFACE;
 }