diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 10 | ||||
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 7682baa8e5..f802b3981c 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -192,7 +192,7 @@ EmitExprForReferenceBinding(CodeGenFunction &CGF, const Expr *E, } RValue RV; - if (E->isLvalue(CGF.getContext()) == Expr::LV_Valid) { + if (E->isLValue()) { // Emit the expression as an lvalue. LValue LV = CGF.EmitLValue(E); if (LV.isPropertyRef() || LV.isKVCRef()) { @@ -235,8 +235,8 @@ EmitExprForReferenceBinding(CodeGenFunction &CGF, const Expr *E, continue; } } else if (const MemberExpr *ME = dyn_cast<MemberExpr>(E)) { - if (ME->getBase()->isLvalue(CGF.getContext()) != Expr::LV_Valid && - ME->getBase()->getType()->isRecordType()) { + if (!ME->isArrow() && ME->getBase()->isRValue()) { + assert(ME->getBase()->getType()->isRecordType()); if (FieldDecl *Field = dyn_cast<FieldDecl>(ME->getMemberDecl())) { E = ME->getBase(); Adjustments.push_back(SubobjectAdjustment(Field)); @@ -1515,7 +1515,7 @@ EmitExtVectorElementExpr(const ExtVectorElementExpr *E) { const PointerType *PT = E->getBase()->getType()->getAs<PointerType>(); Base = MakeAddrLValue(Ptr, PT->getPointeeType()); Base.getQuals().removeObjCGCAttr(); - } else if (E->getBase()->isLvalue(getContext()) == Expr::LV_Valid) { + } else if (E->getBase()->isGLValue()) { // Otherwise, if the base is an lvalue ( as in the case of foo.x.x), // emit the base as an lvalue. assert(E->getBase()->getType()->isVectorType()); @@ -1711,7 +1711,7 @@ LValue CodeGenFunction::EmitCompoundLiteralLValue(const CompoundLiteralExpr *E){ LValue CodeGenFunction::EmitConditionalOperatorLValue(const ConditionalOperator *E) { - if (E->isLvalue(getContext()) == Expr::LV_Valid) { + if (E->isGLValue()) { if (int Cond = ConstantFoldsToSimpleInteger(E->getCond())) { Expr *Live = Cond == 1 ? E->getLHS() : E->getRHS(); if (Live) diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index a5f9890c12..e5ea26c24b 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -1474,7 +1474,7 @@ Value *ScalarExprEmitter::VisitUnaryReal(const UnaryOperator *E) { // If it's an l-value, load through the appropriate subobject l-value. // Note that we have to ask E because Op might be an l-value that // this won't work for, e.g. an Obj-C property. - if (E->isLvalue(CGF.getContext()) == Expr::LV_Valid) + if (E->isGLValue()) return CGF.EmitLoadOfLValue(CGF.EmitLValue(E), E->getType()) .getScalarVal(); @@ -1491,7 +1491,7 @@ Value *ScalarExprEmitter::VisitUnaryImag(const UnaryOperator *E) { // If it's an l-value, load through the appropriate subobject l-value. // Note that we have to ask E because Op might be an l-value that // this won't work for, e.g. an Obj-C property. - if (Op->isLvalue(CGF.getContext()) == Expr::LV_Valid) + if (Op->isGLValue()) return CGF.EmitLoadOfLValue(CGF.EmitLValue(E), E->getType()) .getScalarVal(); @@ -2548,7 +2548,7 @@ LValue CodeGenFunction::EmitObjCIsaExpr(const ObjCIsaExpr *E) { const llvm::Type *ClassPtrTy = ConvertType(E->getType()); Expr *BaseExpr = E->getBase(); - if (BaseExpr->isLvalue(getContext()) != Expr::LV_Valid) { + if (BaseExpr->isRValue()) { V = CreateTempAlloca(ClassPtrTy, "resval"); llvm::Value *Src = EmitScalarExpr(BaseExpr); Builder.CreateStore(Src, V); |