From 30e7864661ffff4ad2c7b542401dbc2172529660 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 12 Jan 2009 23:27:26 +0000 Subject: Patch to implement code gen for aggrgate-valued property used to access a field of its type. llvm-svn: 62123 --- clang/lib/CodeGen/CGExpr.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/lib/CodeGen/CGExpr.cpp') diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 20a7693faf6..2d51efa474e 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -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()) -- cgit v1.2.3