summaryrefslogtreecommitdiffstats
path: root/clang/CodeGen/CGExprComplex.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-26 06:48:56 +0000
committerChris Lattner <sabre@nondot.org>2007-08-26 06:48:56 +0000
commit3474c202ab0a36c9250bfa7e43ec9465e8fd7d00 (patch)
treeddf7d77776a4576e516f88dae7377aa32db93dd0 /clang/CodeGen/CGExprComplex.cpp
parente026ebd6fea306e948540ba9afa26562f21e02e3 (diff)
downloadbcm5719-llvm-3474c202ab0a36c9250bfa7e43ec9465e8fd7d00.tar.gz
bcm5719-llvm-3474c202ab0a36c9250bfa7e43ec9465e8fd7d00.zip
refactor scalar conversions out into CGExprScalar.cpp
llvm-svn: 41433
Diffstat (limited to 'clang/CodeGen/CGExprComplex.cpp')
-rw-r--r--clang/CodeGen/CGExprComplex.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/CodeGen/CGExprComplex.cpp b/clang/CodeGen/CGExprComplex.cpp
index a54bd2cc160..49b5859f8be 100644
--- a/clang/CodeGen/CGExprComplex.cpp
+++ b/clang/CodeGen/CGExprComplex.cpp
@@ -203,10 +203,8 @@ ComplexPairTy ComplexExprEmitter::EmitCast(Expr *Op, QualType DestTy) {
// 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 @@ ComplexPairTy ComplexExprEmitter::EmitCast(Expr *Op, QualType DestTy) {
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()));
OpenPOWER on IntegriCloud