/// interface type, or 0 if there are none.
inline unsigned getNumProtocols() const;
- /// getProtocols - Return the specified qualifying protocol.
- inline ObjCProtocolDecl *getProtocols(unsigned i) const;
-
+ /// getProtocol - Return the specified qualifying protocol.
+ inline ObjCProtocolDecl *getProtocol(unsigned i) const;
virtual void getAsStringInternal(std::string &InnerString) const;
friend class ASTContext; // ASTContext creates these.
public:
- ObjCProtocolDecl *getProtocols(unsigned i) const {
+ ObjCProtocolDecl *getProtocol(unsigned i) const {
return Protocols[i];
}
unsigned getNumProtocols() const {
return 0;
}
-/// getProtocols - Return the specified qualifying protocol.
-inline ObjCProtocolDecl *ObjCInterfaceType::getProtocols(unsigned i) const {
- return cast<ObjCQualifiedInterfaceType>(this)->getProtocols(i);
+/// getProtocol - Return the specified qualifying protocol.
+inline ObjCProtocolDecl *ObjCInterfaceType::getProtocol(unsigned i) const {
+ return cast<ObjCQualifiedInterfaceType>(this)->getProtocol(i);
}
return new ObjCPropertyRefExpr(PD, PD->getType(), MemberLoc, BaseExpr);
// Lastly, check protocols on qualified interfaces.
- if (const ObjCQualifiedInterfaceType *QIT =
- dyn_cast<ObjCQualifiedInterfaceType>(IFTy)) {
- for (unsigned i = 0; i != QIT->getNumProtocols(); ++i)
- if (ObjCPropertyDecl *PD =
- QIT->getProtocols(i)->FindPropertyDeclaration(&Member))
- return new ObjCPropertyRefExpr(PD, PD->getType(), MemberLoc,BaseExpr);
- }
+ for (ObjCInterfaceType::qual_iterator I = IFTy->qual_begin(),
+ E = IFTy->qual_end(); I != E; ++I)
+ if (ObjCPropertyDecl *PD = (*I)->FindPropertyDeclaration(&Member))
+ return new ObjCPropertyRefExpr(PD, PD->getType(), MemberLoc, BaseExpr);
}
// Handle 'field access' to vectors, such as 'V.xx'.
if (!Method) {
// search protocols
for (unsigned i = 0; i < QIT->getNumProtocols(); i++) {
- ObjCProtocolDecl *PDecl = QIT->getProtocols(i);
+ ObjCProtocolDecl *PDecl = QIT->getProtocol(i);
if (PDecl && (Method = PDecl->lookupInstanceMethod(Sel)))
break;
}