From 84c580f6f387523684d56f60c84ec866dca63035 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 11 May 2010 16:31:10 +0000 Subject: [PATCH] Minor refactoring of my last patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103475 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 8b8b65932b..53794152a8 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1672,11 +1672,12 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) { case CastExpr::CK_NoOp: { LValue LV = EmitLValue(E->getSubExpr()); - // FIXME. assign a meaningfull cast kind. if (LV.isPropertyRef()) { - RValue RV = EmitLoadOfPropertyRefLValue(LV, E->getSubExpr()->getType()); - llvm::Value *V = RV.isScalar() ? RV.getScalarVal() : RV.getAggregateAddr(); - return LValue::MakeAddr(V, MakeQualifiers(E->getSubExpr()->getType())); + QualType QT = E->getSubExpr()->getType(); + RValue RV = EmitLoadOfPropertyRefLValue(LV, QT); + assert(!RV.isScalar() && "EmitCastLValue - scalar cast of property ref"); + llvm::Value *V = RV.getAggregateAddr(); + return LValue::MakeAddr(V, MakeQualifiers(QT)); } return LV; } -- 2.40.0