Generalize RValue to handle complex better, generalize EmitCompoundStmt to
support any sort of expr, add a new EmitAnyExpr routine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41660 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGExprScalar.cpp b/CodeGen/CGExprScalar.cpp
index db0e6bf..1cc33bd 100644
--- a/CodeGen/CGExprScalar.cpp
+++ b/CodeGen/CGExprScalar.cpp
@@ -51,7 +51,7 @@
LValue EmitLValue(const Expr *E) { return CGF.EmitLValue(E); }
Value *EmitLoadOfLValue(LValue LV, QualType T) {
- return CGF.EmitLoadOfLValue(LV, T).getVal();
+ return CGF.EmitLoadOfLValue(LV, T).getScalarVal();
}
/// EmitLoadOfLValue - Given an expression with complex type that represents a
@@ -126,7 +126,7 @@
Value *EmitCastExpr(const Expr *E, QualType T);
Value *VisitCallExpr(const CallExpr *E) {
- return CGF.EmitCallExpr(E).getVal();
+ return CGF.EmitCallExpr(E).getScalarVal();
}
Value *VisitStmtExpr(const StmtExpr *E);
@@ -440,7 +440,7 @@
}
Value *ScalarExprEmitter::VisitStmtExpr(const StmtExpr *E) {
- return CGF.EmitCompoundStmt(*E->getSubStmt(), true).getVal();
+ return CGF.EmitCompoundStmt(*E->getSubStmt(), true).getScalarVal();
}
@@ -453,7 +453,7 @@
LValue LV = EmitLValue(E->getSubExpr());
// FIXME: Handle volatile!
Value *InVal = CGF.EmitLoadOfLValue(LV, // false
- E->getSubExpr()->getType()).getVal();
+ E->getSubExpr()->getType()).getScalarVal();
int AmountVal = isInc ? 1 : -1;