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
diff --git a/clang/lib/Sema/SemaPseudoObject.cpp b/clang/lib/Sema/SemaPseudoObject.cpp
index b3ed145..cf43fca 100644
--- a/clang/lib/Sema/SemaPseudoObject.cpp
+++ b/clang/lib/Sema/SemaPseudoObject.cpp
@@ -418,7 +418,14 @@
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);
}