diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-03-30 16:11:20 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-03-30 16:11:20 +0000 |
commit | 7a26ba4d0dd0f47b3c81181f7cf756fc3a71f8cd (patch) | |
tree | 9da3648163804b7fba100de42e5160634e669805 /clang/lib/CodeGen/CGExpr.cpp | |
parent | 499b40e8a7159b5099a7b7f660782cc466ad13cf (diff) | |
download | bcm5719-llvm-7a26ba4d0dd0f47b3c81181f7cf756fc3a71f8cd.tar.gz bcm5719-llvm-7a26ba4d0dd0f47b3c81181f7cf756fc3a71f8cd.zip |
Fix IRGen issues related to using property-dot syntax
for prperty reference types. // rdar://9208606.
llvm-svn: 128551
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 6a7be0fe6e8..ab88a38babf 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/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(); |