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:
Fariborz Jahanian 2009-01-12 23:27:26 +00:00
parent b3730b50c7
commit 30e7864661
2 changed files with 25 additions and 0 deletions

View File

@ -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())

View File

@ -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