aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/ExprTypeConvert.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-18 08:16:27 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-18 08:16:27 +0000
commitdc26a9b84005936b47d8e5901919a789b8ae9139 (patch)
tree366de1ad7f8ab27aa13a1cfe35d7ac00669d2b1c /lib/Transforms/ExprTypeConvert.cpp
parentf6c511cbb1bc867f6c8dfe756d74ce0595b29daa (diff)
Convert the last use of two-argument ConstantExpr::getCast into another
form so we can remove that method from ConstantExpr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32652 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/ExprTypeConvert.cpp')
-rw-r--r--lib/Transforms/ExprTypeConvert.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp
index 1ce6eedbee..814318a587 100644
--- a/lib/Transforms/ExprTypeConvert.cpp
+++ b/lib/Transforms/ExprTypeConvert.cpp
@@ -210,7 +210,9 @@ Value *llvm::ConvertExpressionToType(Value *V, const Type *Ty,
Constant *CPV = cast<Constant>(V);
// Constants are converted by constant folding the cast that is required.
// We assume here that all casts are implemented for constant prop.
- Value *Result = ConstantExpr::getCast(CPV, Ty);
+ Instruction::CastOps opcode = CastInst::getCastOpcode(CPV,
+ CPV->getType()->isSigned(), Ty, Ty->isSigned());
+ Value *Result = ConstantExpr::getCast(opcode, CPV, Ty);
// Add the instruction to the expression map
//VMC.ExprMap[V] = Result;
return Result;