add forward definition protocols to the protocol list for a class.

llvm-svn: 53864
This commit is contained in:
Chris Lattner 2008-07-21 18:35:17 +00:00
parent 461d3f8eb8
commit 102ccc4f8c
1 changed files with 16 additions and 13 deletions

View File

@ -137,12 +137,13 @@ Sema::DeclTy *Sema::ActOnStartClassInterface(
if (!RefPDecl)
Diag(EndProtoLoc, diag::err_undef_protocolref,
ProtocolNames[i]->getName(), ClassName->getName());
else if (RefPDecl->isForwardDecl())
else {
if (RefPDecl->isForwardDecl())
Diag(EndProtoLoc, diag::warn_undef_protocolref,
ProtocolNames[i]->getName(), ClassName->getName());
else
RefProtos.push_back(RefPDecl);
}
}
if (!RefProtos.empty())
IDecl->addReferencedProtocols(&RefProtos[0], RefProtos.size());
IDecl->setLocEnd(EndProtoLoc);
@ -223,12 +224,13 @@ Sema::DeclTy *Sema::ActOnStartProtocolInterface(
if (!RefPDecl)
Diag(ProtocolLoc, diag::err_undef_protocolref,
ProtoRefNames[i]->getName(), ProtocolName->getName());
else if (RefPDecl->isForwardDecl())
else {
if (RefPDecl->isForwardDecl())
Diag(ProtocolLoc, diag::warn_undef_protocolref,
ProtoRefNames[i]->getName(), ProtocolName->getName());
PDecl->setReferencedProtocols(i, RefPDecl);
}
}
PDecl->setLocEnd(EndProtoLoc);
}
return PDecl;
@ -434,12 +436,13 @@ Sema::DeclTy *Sema::ActOnStartCategoryInterface(
if (!RefPDecl)
Diag(CategoryLoc, diag::err_undef_protocolref,
ProtoRefNames[i]->getName(), CategoryName->getName());
else if (RefPDecl->isForwardDecl())
else {
if (RefPDecl->isForwardDecl())
Diag(CategoryLoc, diag::warn_undef_protocolref,
ProtoRefNames[i]->getName(), CategoryName->getName());
if (RefPDecl)
RefProtocols.push_back(RefPDecl);
}
}
if (!RefProtocols.empty())
CDecl->addReferencedProtocols(&RefProtocols[0], RefProtocols.size());
}