summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/AST/Type.h13
-rw-r--r--clang/lib/Sema/SemaExpr.cpp11
-rw-r--r--clang/lib/Sema/SemaExprObjC.cpp2
3 files changed, 11 insertions, 15 deletions
diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h
index 03171b859b5..e35f0aae111 100644
--- a/clang/include/clang/AST/Type.h
+++ b/clang/include/clang/AST/Type.h
@@ -1130,9 +1130,8 @@ public:
/// 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;
@@ -1162,7 +1161,7 @@ class ObjCQualifiedInterfaceType : public ObjCInterfaceType,
friend class ASTContext; // ASTContext creates these.
public:
- ObjCProtocolDecl *getProtocols(unsigned i) const {
+ ObjCProtocolDecl *getProtocol(unsigned i) const {
return Protocols[i];
}
unsigned getNumProtocols() const {
@@ -1207,9 +1206,9 @@ inline unsigned ObjCInterfaceType::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);
}
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 13f7ff9fb71..9813acbd045 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -654,13 +654,10 @@ ActOnMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc,
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'.
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp
index abbc7666e90..e8830bc0ddf 100644
--- a/clang/lib/Sema/SemaExprObjC.cpp
+++ b/clang/lib/Sema/SemaExprObjC.cpp
@@ -284,7 +284,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
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;
}
OpenPOWER on IntegriCloud