mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,3 +65,12 @@ typedef id BYObjectIdentifier;
|
||||
|
||||
// rdar://10127639
|
||||
@synthesize window; // expected-error {{missing context for property implementation declaration}}
|
||||
|
||||
// rdar://10408414
|
||||
Class test6_getClass();
|
||||
@interface Test6
|
||||
@end
|
||||
@implementation Test6
|
||||
+ (float) globalValue { return 5.0f; }
|
||||
+ (float) gv { return test6_getClass().globalValue; }
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user