зеркало из https://github.com/microsoft/clang-1.git
Patch to implement code gen for aggrgate-valued property used
to access a field of its type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62123 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
482b77d1cb
Коммит
35c33293ef
|
@ -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
|
||||
|
Загрузка…
Ссылка в новой задаче