diff options
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/Sema.h | 15 | ||||
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 21 |
2 files changed, 11 insertions, 25 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 7772006510..9584dcc468 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -624,13 +624,14 @@ public: DeclTy * const *ProtoRefNames, unsigned NumProtoRefs, SourceLocation EndProtoLoc); - virtual DeclTy *ActOnStartCategoryInterface( - SourceLocation AtInterfaceLoc, - IdentifierInfo *ClassName, SourceLocation ClassLoc, - IdentifierInfo *CategoryName, SourceLocation CategoryLoc, - const IdentifierLocPair *ProtoRefNames, - unsigned NumProtoRefs, - SourceLocation EndProtoLoc); + virtual DeclTy *ActOnStartCategoryInterface(SourceLocation AtInterfaceLoc, + IdentifierInfo *ClassName, + SourceLocation ClassLoc, + IdentifierInfo *CategoryName, + SourceLocation CategoryLoc, + DeclTy * const *ProtoRefs, + unsigned NumProtoRefs, + SourceLocation EndProtoLoc); virtual DeclTy *ActOnStartClassImplementation( SourceLocation AtClassImplLoc, diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 5bafa236fb..570437d071 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -402,7 +402,7 @@ ActOnStartCategoryInterface(SourceLocation AtInterfaceLoc, IdentifierInfo *ClassName, SourceLocation ClassLoc, IdentifierInfo *CategoryName, SourceLocation CategoryLoc, - const IdentifierLocPair *ProtoRefNames, + DeclTy * const *ProtoRefs, unsigned NumProtoRefs, SourceLocation EndProtoLoc) { ObjCInterfaceDecl *IDecl = getObjCInterfaceDecl(ClassName); @@ -430,24 +430,9 @@ ActOnStartCategoryInterface(SourceLocation AtInterfaceLoc, } if (NumProtoRefs) { - llvm::SmallVector<ObjCProtocolDecl*, 32> RefProtocols; - /// Check and then save the referenced protocols. - for (unsigned int i = 0; i != NumProtoRefs; i++) { - ObjCProtocolDecl* RefPDecl = ObjCProtocols[ProtoRefNames[i].first]; - if (!RefPDecl) - Diag(ProtoRefNames[i].second, diag::err_undeclared_protocol, - ProtoRefNames[i].first->getName()); - else { - if (RefPDecl->isForwardDecl()) - Diag(ProtoRefNames[i].second, diag::warn_undef_protocolref, - ProtoRefNames[i].first->getName()); - RefProtocols.push_back(RefPDecl); - } - } - if (!RefProtocols.empty()) - CDecl->addReferencedProtocols(&RefProtocols[0], RefProtocols.size()); + CDecl->addReferencedProtocols((ObjCProtocolDecl**)ProtoRefs, NumProtoRefs); + CDecl->setLocEnd(EndProtoLoc); } - CDecl->setLocEnd(EndProtoLoc); return CDecl; } |