summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaPseudoObject.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-11-07 22:49:50 +0000
committerJohn McCall <rjmccall@apple.com>2011-11-07 22:49:50 +0000
commitcfef546d40ca0515c3240bdaeb950251cc147421 (patch)
treef38155bd3ddcce36e79b02b96d41fe3eec99a58d /clang/lib/Sema/SemaPseudoObject.cpp
parentc64b5c7c478d442557d76efff8e2b3512ae96bab (diff)
downloadbcm5719-llvm-cfef546d40ca0515c3240bdaeb950251cc147421.tar.gz
bcm5719-llvm-cfef546d40ca0515c3240bdaeb950251cc147421.zip
There are some crazy cases that LookupMethodInReceiverType
doesn't duplicate, but they all surface as implicit properties. It's also a useful optimization to not duplicate the implicit getter lookup. So, trust the getter lookup that was already done in these cases. llvm-svn: 144031
Diffstat (limited to 'clang/lib/Sema/SemaPseudoObject.cpp')
-rw-r--r--clang/lib/Sema/SemaPseudoObject.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaPseudoObject.cpp b/clang/lib/Sema/SemaPseudoObject.cpp
index b3ed145b155..cf43fcad055 100644
--- a/clang/lib/Sema/SemaPseudoObject.cpp
+++ b/clang/lib/Sema/SemaPseudoObject.cpp
@@ -418,7 +418,14 @@ static ObjCMethodDecl *LookupMethodInReceiverType(Sema &S, Selector sel,
bool ObjCPropertyOpBuilder::findGetter() {
if (Getter) return true;
- Getter = LookupMethodInReceiverType(S, RefExpr->getGetterSelector(), RefExpr);
+ // For implicit properties, just trust the lookup we already did.
+ if (RefExpr->isImplicitProperty()) {
+ Getter = RefExpr->getImplicitPropertyGetter();
+ return (Getter != 0);
+ }
+
+ ObjCPropertyDecl *prop = RefExpr->getExplicitProperty();
+ Getter = LookupMethodInReceiverType(S, prop->getGetterName(), RefExpr);
return (Getter != 0);
}
OpenPOWER on IntegriCloud