]> granicus.if.org Git - clang/commitdiff
Fixed copy-and-paste error causing categories to contain the protocols declared on...
authorDavid Chisnall <csdavec@swan.ac.uk>
Sat, 13 Mar 2010 22:20:45 +0000 (22:20 +0000)
committerDavid Chisnall <csdavec@swan.ac.uk>
Sat, 13 Mar 2010 22:20:45 +0000 (22:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98455 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCGNU.cpp

index 198e2d12fca3460f20d219fa948c26997adb635b..243635744ffb29acc9f973127159fd123d478ff4 100644 (file)
@@ -1147,8 +1147,8 @@ void CGObjCGNU::GenerateCategory(const ObjCCategoryImplDecl *OCD) {
 
   // Collect the names of referenced protocols
   llvm::SmallVector<std::string, 16> Protocols;
-  const ObjCInterfaceDecl *ClassDecl = OCD->getClassInterface();
-  const ObjCList<ObjCProtocolDecl> &Protos =ClassDecl->getReferencedProtocols();
+  const ObjCCategoryDecl *CatDecl = OCD->getCategoryDecl();
+  const ObjCList<ObjCProtocolDecl> &Protos = CatDecl->getReferencedProtocols();
   for (ObjCList<ObjCProtocolDecl>::iterator I = Protos.begin(),
        E = Protos.end(); I != E; ++I)
     Protocols.push_back((*I)->getNameAsString());