[cfe-commits] r103475 - /cfe/trunk/lib/CodeGen/CGExpr.cpp
Fariborz Jahanian
fjahanian at apple.com
Tue May 11 09:31:10 PDT 2010
Author: fjahanian
Date: Tue May 11 11:31:10 2010
New Revision: 103475
URL: http://llvm.org/viewvc/llvm-project?rev=103475&view=rev
Log:
Minor refactoring of my last patch.
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=103475&r1=103474&r2=103475&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Tue May 11 11:31:10 2010
@@ -1672,11 +1672,12 @@
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;
}
More information about the cfe-commits
mailing list