[cfe-commits] r53864 - /cfe/trunk/lib/Sema/SemaDeclObjC.cpp
Chris Lattner
sabre at nondot.org
Mon Jul 21 11:35:17 PDT 2008
Author: lattner
Date: Mon Jul 21 13:35:17 2008
New Revision: 53864
URL: http://llvm.org/viewvc/llvm-project?rev=53864&view=rev
Log:
add forward definition protocols to the protocol list for a class.
Modified:
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=53864&r1=53863&r2=53864&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Mon Jul 21 13:35:17 2008
@@ -137,11 +137,12 @@
if (!RefPDecl)
Diag(EndProtoLoc, diag::err_undef_protocolref,
ProtocolNames[i]->getName(), ClassName->getName());
- else if (RefPDecl->isForwardDecl())
- Diag(EndProtoLoc, diag::warn_undef_protocolref,
- ProtocolNames[i]->getName(), ClassName->getName());
- else
+ else {
+ if (RefPDecl->isForwardDecl())
+ Diag(EndProtoLoc, diag::warn_undef_protocolref,
+ ProtocolNames[i]->getName(), ClassName->getName());
RefProtos.push_back(RefPDecl);
+ }
}
if (!RefProtos.empty())
IDecl->addReferencedProtocols(&RefProtos[0], RefProtos.size());
@@ -223,11 +224,12 @@
if (!RefPDecl)
Diag(ProtocolLoc, diag::err_undef_protocolref,
ProtoRefNames[i]->getName(), ProtocolName->getName());
- else if (RefPDecl->isForwardDecl())
- Diag(ProtocolLoc, diag::warn_undef_protocolref,
- ProtoRefNames[i]->getName(), ProtocolName->getName());
-
- PDecl->setReferencedProtocols(i, RefPDecl);
+ else {
+ if (RefPDecl->isForwardDecl())
+ Diag(ProtocolLoc, diag::warn_undef_protocolref,
+ ProtoRefNames[i]->getName(), ProtocolName->getName());
+ PDecl->setReferencedProtocols(i, RefPDecl);
+ }
}
PDecl->setLocEnd(EndProtoLoc);
}
@@ -434,11 +436,12 @@
if (!RefPDecl)
Diag(CategoryLoc, diag::err_undef_protocolref,
ProtoRefNames[i]->getName(), CategoryName->getName());
- else if (RefPDecl->isForwardDecl())
- Diag(CategoryLoc, diag::warn_undef_protocolref,
- ProtoRefNames[i]->getName(), CategoryName->getName());
- if (RefPDecl)
+ else {
+ if (RefPDecl->isForwardDecl())
+ Diag(CategoryLoc, diag::warn_undef_protocolref,
+ ProtoRefNames[i]->getName(), CategoryName->getName());
RefProtocols.push_back(RefPDecl);
+ }
}
if (!RefProtocols.empty())
CDecl->addReferencedProtocols(&RefProtocols[0], RefProtocols.size());
More information about the cfe-commits
mailing list