diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-05-11 16:31:10 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-05-11 16:31:10 +0000 |
commit | 84c580f6f387523684d56f60c84ec866dca63035 (patch) | |
tree | e70ce4526e6bdc27878fa2fbac217ea9447f2a5e | |
parent | 7ed5bd3e27a6f2b37ee0449aa818116cbd03306e (diff) |
Minor refactoring of my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103475 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 9 |
1 files 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; } |