From 0e800c9c20d1a658a91096c756c4a4a9e90264fc Mon Sep 17 00:00:00 2001 From: John McCall Date: Sat, 4 Dec 2010 08:14:53 +0000 Subject: Remove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn't be required, and then fix up some missing loads on overloaded-operator paths which that exposed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120896 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 78605ba8b1..35ba2543ef 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -195,13 +195,6 @@ EmitExprForReferenceBinding(CodeGenFunction &CGF, const Expr *E, if (E->isLValue()) { // Emit the expression as an lvalue. LValue LV = CGF.EmitLValue(E); - if (LV.isPropertyRef()) { - QualType QT = E->getType(); - RValue RV = CGF.EmitLoadOfPropertyRefLValue(LV); - assert(RV.isScalar() && "EmitExprForReferenceBinding"); - return RV.getScalarVal(); - } - if (LV.isSimple()) return LV.getAddress(); @@ -1537,11 +1530,6 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) { const PointerType *PTy = BaseExpr->getType()->getAs(); BaseQuals = PTy->getPointeeType().getQualifiers(); - } else if (ObjCPropertyRefExpr *PRE - = dyn_cast(BaseExpr->IgnoreParens())) { - RValue RV = EmitLoadOfPropertyRefLValue(EmitObjCPropertyRefLValue(PRE)); - BaseValue = RV.getAggregateAddr(); - BaseQuals = BaseExpr->getType().getQualifiers(); } else { LValue BaseLV = EmitLValue(BaseExpr); if (BaseLV.isNonGC()) @@ -1771,17 +1759,8 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) { } case CK_NoOp: - if (!E->getSubExpr()->isRValue() || E->getType()->isRecordType()) { - LValue LV = EmitLValue(E->getSubExpr()); - if (LV.isPropertyRef()) { - QualType QT = E->getSubExpr()->getType(); - RValue RV = EmitLoadOfPropertyRefLValue(LV); - assert(RV.isAggregate()); - llvm::Value *V = RV.getAggregateAddr(); - return MakeAddrLValue(V, QT); - } - return LV; - } + if (!E->getSubExpr()->isRValue() || E->getType()->isRecordType()) + return EmitLValue(E->getSubExpr()); // Fall through to synthesize a temporary. case CK_LValueToRValue: @@ -1843,15 +1822,7 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) { cast(DerivedClassTy->getDecl()); LValue LV = EmitLValue(E->getSubExpr()); - llvm::Value *This; - if (LV.isPropertyRef()) { - QualType QT = E->getSubExpr()->getType(); - RValue RV = EmitLoadOfPropertyRefLValue(LV); - assert (!RV.isScalar() && "EmitCastLValue"); - This = RV.getAggregateAddr(); - } - else - This = LV.getAddress(); + llvm::Value *This = LV.getAddress(); // Perform the derived-to-base conversion llvm::Value *Base = -- cgit v1.2.3