diff options
| author | John McCall <rjmccall@apple.com> | 2010-12-02 01:19:52 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-12-02 01:19:52 +0000 |
| commit | 12f78a6741a4cb3d904340f8d3d2714568b50e7a (patch) | |
| tree | 7d3c0d003eb7060d7a7a985d6f4fa284f9207c35 /lib/CodeGen/CGExpr.cpp | |
| parent | 9d0b2b728b9a431546b11252793844bf7506ec84 (diff) | |
| download | clang-12f78a6741a4cb3d904340f8d3d2714568b50e7a.tar.gz clang-12f78a6741a4cb3d904340f8d3d2714568b50e7a.tar.bz2 clang-12f78a6741a4cb3d904340f8d3d2714568b50e7a.tar.xz | |
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
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
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<ObjCIvarRefExpr>(E)); case Expr::ObjCPropertyRefExprClass: return EmitObjCPropertyRefLValue(cast<ObjCPropertyRefExpr>(E)); - case Expr::ObjCImplicitSetterGetterRefExprClass: - return EmitObjCKVCRefLValue(cast<ObjCImplicitSetterGetterRefExpr>(E)); case Expr::StmtExprClass: return EmitStmtExprLValue(cast<StmtExpr>(E)); case Expr::UnaryOperatorClass: @@ -1569,10 +1567,9 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) { const PointerType *PTy = BaseExpr->getType()->getAs<PointerType>(); BaseQuals = PTy->getPointeeType().getQualifiers(); - } else if (isa<ObjCPropertyRefExpr>(BaseExpr->IgnoreParens()) || - isa<ObjCImplicitSetterGetterRefExpr>( - BaseExpr->IgnoreParens())) { - RValue RV = EmitObjCPropertyGet(BaseExpr); + } else if (ObjCPropertyRefExpr *PRE + = dyn_cast<ObjCPropertyRefExpr>(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) { |
