diff options
author | John McCall <rjmccall@apple.com> | 2010-12-04 02:32:38 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-12-04 02:32:38 +0000 |
commit | 119a1c6c4029d30cae7b31a2826aa0ff70d01668 (patch) | |
tree | eaec3cc289e887d12238c3f9b47d706f7312db0a /lib/CodeGen/CGExprComplex.cpp | |
parent | 91252d115bdb6f937192a8dbc86c5abe00101436 (diff) |
Kill the KVC l-value kind and calculate the base expression when emitting
the l-value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120884 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprComplex.cpp')
-rw-r--r-- | lib/CodeGen/CGExprComplex.cpp | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index 5784825d6f..e1d042ba9a 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/lib/CodeGen/CGExprComplex.cpp @@ -64,11 +64,8 @@ public: if (LV.isSimple()) return EmitLoadOfComplex(LV.getAddress(), LV.isVolatileQualified()); - if (LV.isPropertyRef()) - return CGF.EmitObjCPropertyGet(LV.getPropertyRefExpr()).getComplexVal(); - - assert(LV.isKVCRef() && "Unknown LValue type!"); - return CGF.EmitObjCPropertyGet(LV.getKVCRefExpr()).getComplexVal(); + assert(LV.isPropertyRef() && "Unknown LValue type!"); + return CGF.EmitLoadOfPropertyRefLValue(LV).getComplexVal(); } /// EmitLoadOfComplex - Given a pointer to a complex value, emit code to load @@ -531,11 +528,7 @@ EmitCompoundAssignLValue(const CompoundAssignOperator *E, // We know the LHS is a complex lvalue. ComplexPairTy LHSComplexPair; if (LHS.isPropertyRef()) - LHSComplexPair = - CGF.EmitObjCPropertyGet(LHS.getPropertyRefExpr()).getComplexVal(); - else if (LHS.isKVCRef()) - LHSComplexPair = - CGF.EmitObjCPropertyGet(LHS.getKVCRefExpr()).getComplexVal(); + LHSComplexPair = CGF.EmitLoadOfPropertyRefLValue(LHS).getComplexVal(); else LHSComplexPair = EmitLoadOfComplex(LHS.getAddress(), LHS.isVolatileQualified()); @@ -551,10 +544,7 @@ EmitCompoundAssignLValue(const CompoundAssignOperator *E, // Store the result value into the LHS lvalue. if (LHS.isPropertyRef()) - CGF.EmitObjCPropertySet(LHS.getPropertyRefExpr(), - RValue::getComplex(Result)); - else if (LHS.isKVCRef()) - CGF.EmitObjCPropertySet(LHS.getKVCRefExpr(), RValue::getComplex(Result)); + CGF.EmitStoreThroughPropertyRefLValue(RValue::getComplex(Result), LHS); else EmitStoreOfComplex(Result, LHS.getAddress(), LHS.isVolatileQualified()); @@ -573,7 +563,7 @@ EmitCompoundAssign(const CompoundAssignOperator *E, return Val; // Objective-C property assignment never reloads the value following a store. - if (LV.isPropertyRef() || LV.isKVCRef()) + if (LV.isPropertyRef()) return Val; // If the lvalue is non-volatile, return the computed value of the assignment. @@ -599,9 +589,7 @@ LValue ComplexExprEmitter::EmitBinAssignLValue(const BinaryOperator *E, // Store the result value into the LHS lvalue. if (LHS.isPropertyRef()) - CGF.EmitObjCPropertySet(LHS.getPropertyRefExpr(), RValue::getComplex(Val)); - else if (LHS.isKVCRef()) - CGF.EmitObjCPropertySet(LHS.getKVCRefExpr(), RValue::getComplex(Val)); + CGF.EmitStoreThroughPropertyRefLValue(RValue::getComplex(Val), LHS); else EmitStoreOfComplex(Val, LHS.getAddress(), LHS.isVolatileQualified()); @@ -617,7 +605,7 @@ ComplexPairTy ComplexExprEmitter::VisitBinAssign(const BinaryOperator *E) { return Val; // Objective-C property assignment never reloads the value following a store. - if (LV.isPropertyRef() || LV.isKVCRef()) + if (LV.isPropertyRef()) return Val; // If the lvalue is non-volatile, return the computed value of the assignment. |