summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-03-30 16:11:20 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-03-30 16:11:20 +0000
commit68af13f3ca39947e3f285f864fe3b76640fddf69 (patch)
treeeb28711c1df0ed3a344dcc8e5fb223eccf1f8a7c /lib/CodeGen/CGExpr.cpp
parentbbf3bacb3e0c1ebb3e8a4a8b1330404a7e379315 (diff)
downloadclang-68af13f3ca39947e3f285f864fe3b76640fddf69.tar.gz
clang-68af13f3ca39947e3f285f864fe3b76640fddf69.tar.bz2
clang-68af13f3ca39947e3f285f864fe3b76640fddf69.tar.xz
Fix IRGen issues related to using property-dot syntax
for prperty reference types. // rdar://9208606. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128551 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 6a7be0fe6e..ab88a38bab 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -216,10 +216,19 @@ EmitExprForReferenceBinding(CodeGenFunction &CGF, const Expr *E,
InitializedDecl);
}
+ if (const ObjCPropertyRefExpr *PRE =
+ dyn_cast<ObjCPropertyRefExpr>(E->IgnoreParenImpCasts()))
+ if (PRE->getGetterResultType()->isReferenceType())
+ E = PRE;
+
RValue RV;
if (E->isGLValue()) {
// Emit the expression as an lvalue.
LValue LV = CGF.EmitLValue(E);
+ if (LV.isPropertyRef()) {
+ RV = CGF.EmitLoadOfPropertyRefLValue(LV);
+ return RV.getScalarVal();
+ }
if (LV.isSimple())
return LV.getAddress();