summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-12-10 00:21:50 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-12-10 00:21:50 +0000
commit7572ac5614e189e4498ffe2b98791544cd0d66ec (patch)
tree5198ad409eb7aae28d2df1e94bff29057df29852 /clang/lib/Sema/SemaExpr.cpp
parent288fbd2133d3243e4c29496d0f738540a0b0305e (diff)
downloadbcm5719-llvm-7572ac5614e189e4498ffe2b98791544cd0d66ec.tar.gz
bcm5719-llvm-7572ac5614e189e4498ffe2b98791544cd0d66ec.zip
Patch to allow a getter call using property dot-syntax notation.
llvm-svn: 60816
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index cdca6827049..a2dc7f7c891 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -1309,9 +1309,16 @@ ActOnMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc,
if (OpKind == tok::period && (QIdTy = BaseType->getAsObjCQualifiedIdType())) {
// Check protocols on qualified interfaces.
for (ObjCQualifiedIdType::qual_iterator I = QIdTy->qual_begin(),
- E = QIdTy->qual_end(); I != E; ++I)
+ E = QIdTy->qual_end(); I != E; ++I) {
if (ObjCPropertyDecl *PD = (*I)->FindPropertyDeclaration(&Member))
return new ObjCPropertyRefExpr(PD, PD->getType(), MemberLoc, BaseExpr);
+ // Also must look for a getter name which uses property syntax.
+ Selector Sel = PP.getSelectorTable().getNullarySelector(&Member);
+ if (ObjCMethodDecl *OMD = (*I)->getInstanceMethod(Sel)) {
+ return new ObjCMessageExpr(BaseExpr, Sel, OMD->getResultType(), OMD,
+ OpLoc, MemberLoc, NULL, 0);
+ }
+ }
}
// Handle 'field access' to vectors, such as 'V.xx'.
if (BaseType->isExtVectorType() && OpKind == tok::period) {
OpenPOWER on IntegriCloud