]> granicus.if.org Git - clang/commitdiff
Send code generation for xvalues down the same path as lvalues
authorDouglas Gregor <dgregor@apple.com>
Sat, 22 Jan 2011 02:44:21 +0000 (02:44 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sat, 22 Jan 2011 02:44:21 +0000 (02:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124023 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExpr.cpp
lib/CodeGen/CGExprScalar.cpp

index bdc4ef723ab3fb53f447f6360ef2cd29a4e263fb..8e5ee759722155992aa7be104a32e9d3ce88d84c 100644 (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())
index a648b9c6b3b6770e5fb66c51f62970a16c1662a9..745757977a0b49caca337f8c689ba18ebcfe3b7f 100644 (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();