forked from OSchip/llvm-project
Patch to implement code gen for aggrgate-valued property used
to access a field of its type. llvm-svn: 62123
This commit is contained in:
parent
b3730b50c7
commit
30e7864661
|
@ -802,6 +802,14 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) {
|
|||
isUnion = true;
|
||||
CVRQualifiers = PTy->getPointeeType().getCVRQualifiers();
|
||||
}
|
||||
else if (BaseExpr->getStmtClass() == Expr::ObjCPropertyRefExprClass ||
|
||||
BaseExpr->getStmtClass() == Expr::ObjCKVCRefExprClass) {
|
||||
RValue RV = EmitObjCPropertyGet(BaseExpr);
|
||||
BaseValue = RV.getAggregateAddr();
|
||||
if (BaseExpr->getType()->isUnionType())
|
||||
isUnion = true;
|
||||
CVRQualifiers = BaseExpr->getType().getCVRQualifiers();
|
||||
}
|
||||
else {
|
||||
LValue BaseLV = EmitLValue(BaseExpr);
|
||||
if (BaseLV.isObjCIvar())
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
// RUN: clang -emit-llvm -o %t %s
|
||||
|
||||
typedef struct {
|
||||
unsigned f0;
|
||||
} s0;
|
||||
|
||||
@interface A
|
||||
- (s0) f0;
|
||||
@end
|
||||
|
||||
@implementation A
|
||||
-(s0) f0{}
|
||||
- (unsigned) bar {
|
||||
return self.f0.f0;
|
||||
}
|
||||
@end
|
||||
|
Loading…
Reference in New Issue