From c109a259d2095dc78dfc1291bddab5c7737ce375 Mon Sep 17 00:00:00 2001 From: John McCall Date: Mon, 7 Nov 2011 03:59:57 +0000 Subject: Rip the ObjCPropertyRef l-value kind out of IR-generation. llvm-svn: 143908 --- clang/lib/CodeGen/CGExprAgg.cpp | 45 ++++++++--------------------------------- 1 file changed, 8 insertions(+), 37 deletions(-) (limited to 'clang/lib/CodeGen/CGExprAgg.cpp') diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index ffbc2e0732f..cbb5dfee0db 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/lib/CodeGen/CGExprAgg.cpp @@ -131,7 +131,6 @@ public: void VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) { EmitAggLoadOfLValue(E); } - void VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E); void VisitAbstractConditionalOperator(const AbstractConditionalOperator *CO); void VisitChooseExpr(const ChooseExpr *CE); @@ -334,14 +333,7 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) { "should have been unpacked before we got here"); } - case CK_GetObjCProperty: { - LValue LV = - CGF.EmitObjCPropertyRefLValue(E->getSubExpr()->getObjCProperty()); - assert(LV.isPropertyRef()); - RValue RV = CGF.EmitLoadOfPropertyRefLValue(LV, getReturnValueSlot()); - EmitMoveFromReturnSlot(E, RV); - break; - } + case CK_GetObjCProperty: llvm_unreachable("GetObjCProperty!"); case CK_LValueToRValue: // hope for downstream optimization case CK_NoOp: @@ -414,11 +406,6 @@ void AggExprEmitter::VisitObjCMessageExpr(ObjCMessageExpr *E) { EmitMoveFromReturnSlot(E, RV); } -void AggExprEmitter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) { - llvm_unreachable("direct property access not surrounded by " - "lvalue-to-rvalue cast"); -} - void AggExprEmitter::VisitBinComma(const BinaryOperator *E) { CGF.EmitIgnoredExpr(E->getLHS()); Visit(E->getRHS()); @@ -466,29 +453,13 @@ void AggExprEmitter::VisitBinAssign(const BinaryOperator *E) { LValue LHS = CGF.EmitLValue(E->getLHS()); - // We have to special case property setters, otherwise we must have - // a simple lvalue (no aggregates inside vectors, bitfields). - if (LHS.isPropertyRef()) { - const ObjCPropertyRefExpr *RE = LHS.getPropertyRefExpr(); - QualType ArgType = RE->getSetterArgType(); - RValue Src; - if (ArgType->isReferenceType()) - Src = CGF.EmitReferenceBindingToExpr(E->getRHS(), 0); - else { - AggValueSlot Slot = EnsureSlot(E->getRHS()->getType()); - CGF.EmitAggExpr(E->getRHS(), Slot); - Src = Slot.asRValue(); - } - CGF.EmitStoreThroughPropertyRefLValue(Src, LHS); - } else { - // Codegen the RHS so that it stores directly into the LHS. - AggValueSlot LHSSlot = - AggValueSlot::forLValue(LHS, AggValueSlot::IsDestructed, - needsGC(E->getLHS()->getType()), - AggValueSlot::IsAliased); - CGF.EmitAggExpr(E->getRHS(), LHSSlot, false); - EmitFinalDestCopy(E, LHS, true); - } + // Codegen the RHS so that it stores directly into the LHS. + AggValueSlot LHSSlot = + AggValueSlot::forLValue(LHS, AggValueSlot::IsDestructed, + needsGC(E->getLHS()->getType()), + AggValueSlot::IsAliased); + CGF.EmitAggExpr(E->getRHS(), LHSSlot, false); + EmitFinalDestCopy(E, LHS, true); } void AggExprEmitter:: -- cgit v1.2.3