From cf3da8495ae94ea7d3e6a2a47f048dfce728ca8f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 26 Aug 2007 07:08:39 +0000 Subject: [PATCH] remove uses of EmitConversion llvm-svn: 41435 --- clang/CodeGen/CGExprScalar.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/clang/CodeGen/CGExprScalar.cpp b/clang/CodeGen/CGExprScalar.cpp index f1989893e786..b1f26d61bea9 100644 --- a/clang/CodeGen/CGExprScalar.cpp +++ b/clang/CodeGen/CGExprScalar.cpp @@ -511,14 +511,13 @@ Value *ScalarExprEmitter::EmitCompoundAssign(const BinaryOperator *E, // FIXME: it's possible for the computation type to be complex if the RHS // is complex. Handle this! - OpInfo.LHS = CGF.EmitConversion(RValue::get(OpInfo.LHS), LHSTy, - ComputeType).getVal(); + OpInfo.LHS = EmitScalarConversion(OpInfo.LHS, LHSTy, ComputeType); // Do not merge types for -= where the LHS is a pointer. if (E->getOpcode() != BinaryOperator::SubAssign || !E->getLHS()->getType()->isPointerType()) { - OpInfo.RHS = CGF.EmitConversion(RValue::get(OpInfo.RHS), RHSTy, - ComputeType).getVal(); + // FIXME: the computation type may be complex. + OpInfo.RHS = EmitScalarConversion(OpInfo.RHS, RHSTy, ComputeType); } OpInfo.Ty = ComputeType; OpInfo.E = E; @@ -527,7 +526,7 @@ Value *ScalarExprEmitter::EmitCompoundAssign(const BinaryOperator *E, Value *Result = (this->*Func)(OpInfo); // Truncate the result back to the LHS type. - Result = CGF.EmitConversion(RValue::get(Result), ComputeType, LHSTy).getVal(); + Result = EmitScalarConversion(Result, ComputeType, LHSTy); // Store the result value into the LHS lvalue. CGF.EmitStoreThroughLValue(RValue::get(Result), LHSLV, E->getType());