Send code generation for xvalues down the same path as lvalues

llvm-svn: 124023
This commit is contained in:
Douglas Gregor 2011-01-22 02:44:21 +00:00
parent b8c7fe9dc9
commit 9c399a29fd
2 changed files with 2 additions and 2 deletions

View File

@ -202,7 +202,7 @@ EmitExprForReferenceBinding(CodeGenFunction &CGF, const Expr *E,
}
RValue RV;
if (E->isLValue()) {
if (E->isGLValue()) {
// Emit the expression as an lvalue.
LValue LV = CGF.EmitLValue(E);
if (LV.isSimple())

View File

@ -1110,7 +1110,7 @@ Value *ScalarExprEmitter::EmitCastExpr(CastExpr *CE) {
case CK_GetObjCProperty: {
assert(CGF.getContext().hasSameUnqualifiedType(E->getType(), DestTy));
assert(E->isLValue() && E->getObjectKind() == OK_ObjCProperty &&
assert(E->isGLValue() && E->getObjectKind() == OK_ObjCProperty &&
"CK_GetObjCProperty for non-lvalue or non-ObjCProperty");
RValue RV = CGF.EmitLoadOfLValue(CGF.EmitLValue(E), E->getType());
return RV.getScalarVal();