aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGExprComplex.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp
index ee104b7635..0a0c9149b4 100644
--- a/lib/CodeGen/CGExprComplex.cpp
+++ b/lib/CodeGen/CGExprComplex.cpp
@@ -524,13 +524,14 @@ EmitCompoundAssign(const CompoundAssignOperator *E,
OpInfo.RHS = EmitCast(E->getRHS(), OpInfo.Ty);
LValue LHSLV = CGF.EmitLValue(E->getLHS());
- assert(!LHSLV.isKVCRef() &&
- "setter/getter access of complex using property syntax NYI");
// We know the LHS is a complex lvalue.
ComplexPairTy LHSComplexPair;
if (LHSLV.isPropertyRef())
LHSComplexPair =
CGF.EmitObjCPropertyGet(LHSLV.getPropertyRefExpr()).getComplexVal();
+ else if (LHSLV.isKVCRef())
+ LHSComplexPair =
+ CGF.EmitObjCPropertyGet(LHSLV.getKVCRefExpr()).getComplexVal();
else
LHSComplexPair = EmitLoadOfComplex(LHSLV.getAddress(),
LHSLV.isVolatileQualified());
@@ -547,6 +548,8 @@ EmitCompoundAssign(const CompoundAssignOperator *E,
if (LHSLV.isPropertyRef())
CGF.EmitObjCPropertySet(LHSLV.getPropertyRefExpr(),
RValue::getComplex(Result));
+ else if (LHSLV.isKVCRef())
+ CGF.EmitObjCPropertySet(LHSLV.getKVCRefExpr(), RValue::getComplex(Result));
else
EmitStoreOfComplex(Result, LHSLV.getAddress(), LHSLV.isVolatileQualified());
// And now return the LHS
@@ -556,6 +559,8 @@ EmitCompoundAssign(const CompoundAssignOperator *E,
IgnoreImagAssign = ignimag;
if (LHSLV.isPropertyRef())
return CGF.EmitObjCPropertyGet(LHSLV.getPropertyRefExpr()).getComplexVal();
+ else if (LHSLV.isKVCRef())
+ return CGF.EmitObjCPropertyGet(LHSLV.getKVCRefExpr()).getComplexVal();
return EmitLoadOfComplex(LHSLV.getAddress(), LHSLV.isVolatileQualified());
}