diff options
author | Chris Lattner <sabre@nondot.org> | 2008-07-26 04:03:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-07-26 04:03:38 +0000 |
commit | e13b9595dc1e2f4288bec34f3412359f648e84a5 (patch) | |
tree | 187b55589c94501a9359e44de81663a2edffb6b0 /lib/Sema/SemaDeclObjC.cpp | |
parent | eacc39212e5960b2680067c006384c2e4804873a (diff) |
pull protocol resolution out into ActOnStartProtocolInterface.
This temporarily duplicates ParseObjCProtocolReferences, but it
will be removed in the future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54092 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 9d2869be8a..5bafa236fb 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -195,11 +195,13 @@ Sema::DeclTy *Sema::ActOnCompatiblityAlias(SourceLocation AtLoc, return AliasDecl; } -Sema::DeclTy *Sema::ActOnStartProtocolInterface( - SourceLocation AtProtoInterfaceLoc, - IdentifierInfo *ProtocolName, SourceLocation ProtocolLoc, - const IdentifierLocPair *ProtoRefNames, unsigned NumProtoRefs, - SourceLocation EndProtoLoc) { +Sema::DeclTy * +Sema::ActOnStartProtocolInterface(SourceLocation AtProtoInterfaceLoc, + IdentifierInfo *ProtocolName, + SourceLocation ProtocolLoc, + DeclTy * const *ProtoRefs, + unsigned NumProtoRefs, + SourceLocation EndProtoLoc) { assert(ProtocolName && "Missing protocol identifier"); ObjCProtocolDecl *PDecl = ObjCProtocols[ProtocolName]; if (PDecl) { @@ -221,21 +223,7 @@ Sema::DeclTy *Sema::ActOnStartProtocolInterface( if (NumProtoRefs) { /// Check then save referenced protocols. - llvm::SmallVector<ObjCProtocolDecl*, 8> 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()); - Protocols.push_back(RefPDecl); - } - } - if (!Protocols.empty()) - PDecl->addReferencedProtocols(&Protocols[0], Protocols.size()); + PDecl->addReferencedProtocols((ObjCProtocolDecl**)ProtoRefs, NumProtoRefs); PDecl->setLocEnd(EndProtoLoc); } return PDecl; @@ -245,7 +233,7 @@ Sema::DeclTy *Sema::ActOnStartProtocolInterface( /// issuer error if they are not declared. It returns list of protocol /// declarations in its 'Protocols' argument. void -Sema::FindProtocolDeclaration(SourceLocation TypeLoc, bool WarnOnDeclarations, +Sema::FindProtocolDeclaration(bool WarnOnDeclarations, const IdentifierLocPair *ProtocolId, unsigned NumProtocols, llvm::SmallVectorImpl<DeclTy*> &Protocols) { |