Kill the KVC l-value kind and calculate the base expression when emitting

the l-value.

llvm-svn: 120884
This commit is contained in:
John McCall
2010-12-04 02:32:38 +00:00
parent 7788e5fd64
commit f3eb96fccf
8 changed files with 62 additions and 140 deletions

View File

@@ -349,7 +349,8 @@ void AggExprEmitter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
}
void AggExprEmitter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
RValue RV = CGF.EmitObjCPropertyGet(E, getReturnValueSlot());
RValue RV = CGF.EmitLoadOfPropertyRefLValue(CGF.EmitObjCPropertyRefLValue(E),
getReturnValueSlot());
EmitGCMove(E, RV);
}
@@ -388,11 +389,7 @@ void AggExprEmitter::VisitBinAssign(const BinaryOperator *E) {
if (LHS.isPropertyRef()) {
AggValueSlot Slot = EnsureSlot(E->getRHS()->getType());
CGF.EmitAggExpr(E->getRHS(), Slot);
CGF.EmitObjCPropertySet(LHS.getPropertyRefExpr(), Slot.asRValue());
} else if (LHS.isKVCRef()) {
AggValueSlot Slot = EnsureSlot(E->getRHS()->getType());
CGF.EmitAggExpr(E->getRHS(), Slot);
CGF.EmitObjCPropertySet(LHS.getKVCRefExpr(), Slot.asRValue());
CGF.EmitStoreThroughPropertyRefLValue(Slot.asRValue(), LHS);
} else {
bool GCollection = false;
if (CGF.getContext().getLangOptions().getGCMode())