refactor scalar conversions out into CGExprScalar.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41433 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGExprComplex.cpp b/CodeGen/CGExprComplex.cpp
index a54bd2c..49b5859 100644
--- a/CodeGen/CGExprComplex.cpp
+++ b/CodeGen/CGExprComplex.cpp
@@ -203,10 +203,8 @@
// rules for the corresponding real types.
ComplexPairTy Res = Visit(Op);
QualType SrcEltTy = CT->getElementType();
- Res.first = CGF.EmitConversion(RValue::get(Res.first), SrcEltTy,
- DestTy).getVal();
- Res.second = CGF.EmitConversion(RValue::get(Res.second), SrcEltTy,
- DestTy).getVal();
+ Res.first = CGF.EmitScalarConversion(Res.first, SrcEltTy, DestTy);
+ Res.second = CGF.EmitScalarConversion(Res.second, SrcEltTy, DestTy);
return Res;
}
// C99 6.3.1.7: When a value of real type is converted to a complex type, the
@@ -216,7 +214,7 @@
llvm::Value *Elt = CGF.EmitScalarExpr(Op);
// Convert the input element to the element type of the complex.
- Elt = CGF.EmitConversion(RValue::get(Elt), Op->getType(), DestTy).getVal();
+ Elt = CGF.EmitScalarConversion(Elt, Op->getType(), DestTy);
// Return (realval, 0).
return ComplexPairTy(Elt, llvm::Constant::getNullValue(Elt->getType()));