diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-18 20:47:25 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-18 20:47:25 +0000 |
commit | dc5ea09c4d0a23b1cd28f763869ef2bcb5dc119a (patch) | |
tree | a50ad17e20513cb4290a30e5bf10d12d7506097f /lib/CodeGen/CGExpr.cpp | |
parent | 1fb019bf42f5757c027edb56e5bb70233787a39c (diff) |
Fixes IRgen bug in objc++ reference binding of a
getter expression.
Fixes // rdar://8437240
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 924ca3ec4b..9b69297bbe 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -196,7 +196,15 @@ EmitExprForReferenceBinding(CodeGenFunction &CGF, const Expr *E, if (E->isLvalue(CGF.getContext()) == Expr::LV_Valid) { // Emit the expression as an lvalue. LValue LV = CGF.EmitLValue(E); - + if (LV.isPropertyRef() || LV.isKVCRef()) { + QualType QT = E->getType(); + RValue RV = + LV.isPropertyRef() ? CGF.EmitLoadOfPropertyRefLValue(LV, QT) + : CGF.EmitLoadOfKVCRefLValue(LV, QT); + assert(RV.isScalar() && "EmitExprForReferenceBinding"); + return RV.getScalarVal(); + } + if (LV.isSimple()) return LV.getAddress(); |