From 12f78a6741a4cb3d904340f8d3d2714568b50e7a Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 2 Dec 2010 01:19:52 +0000 Subject: Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ObjCPropertyRefExpr into the latter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120643 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 466f55f341..2db6cc8d31 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -549,8 +549,6 @@ LValue CodeGenFunction::EmitLValue(const Expr *E) { return EmitObjCIvarRefLValue(cast(E)); case Expr::ObjCPropertyRefExprClass: return EmitObjCPropertyRefLValue(cast(E)); - case Expr::ObjCImplicitSetterGetterRefExprClass: - return EmitObjCKVCRefLValue(cast(E)); case Expr::StmtExprClass: return EmitStmtExprLValue(cast(E)); case Expr::UnaryOperatorClass: @@ -1569,10 +1567,9 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) { const PointerType *PTy = BaseExpr->getType()->getAs(); BaseQuals = PTy->getPointeeType().getQualifiers(); - } else if (isa(BaseExpr->IgnoreParens()) || - isa( - BaseExpr->IgnoreParens())) { - RValue RV = EmitObjCPropertyGet(BaseExpr); + } else if (ObjCPropertyRefExpr *PRE + = dyn_cast(BaseExpr->IgnoreParens())) { + RValue RV = EmitObjCPropertyGet(PRE); BaseValue = RV.getAggregateAddr(); BaseQuals = BaseExpr->getType().getQualifiers(); } else { @@ -1796,7 +1793,7 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) { RValue RV = LV.isPropertyRef() ? EmitLoadOfPropertyRefLValue(LV, QT) : EmitLoadOfKVCRefLValue(LV, QT); - assert(!RV.isScalar() && "EmitCastLValue-scalar cast of property ref"); + assert(RV.isAggregate()); llvm::Value *V = RV.getAggregateAddr(); return MakeAddrLValue(V, QT); } @@ -2107,16 +2104,12 @@ LValue CodeGenFunction::EmitObjCIvarRefLValue(const ObjCIvarRefExpr *E) { LValue CodeGenFunction::EmitObjCPropertyRefLValue(const ObjCPropertyRefExpr *E) { - // This is a special l-value that just issues sends when we load or store - // through it. - return LValue::MakePropertyRef(E, E->getType().getCVRQualifiers()); -} + // This is a special l-value that just issues sends when we load or + // store through it. -LValue CodeGenFunction::EmitObjCKVCRefLValue( - const ObjCImplicitSetterGetterRefExpr *E) { - // This is a special l-value that just issues sends when we load or store - // through it. - return LValue::MakeKVCRef(E, E->getType().getCVRQualifiers()); + if (E->isImplicitProperty()) + return LValue::MakeKVCRef(E, E->getType().getCVRQualifiers()); + return LValue::MakePropertyRef(E, E->getType().getCVRQualifiers()); } LValue CodeGenFunction::EmitStmtExprLValue(const StmtExpr *E) { -- cgit v1.2.3