Convert the last use of two-argument ConstantExpr::getCast into another
authorReid Spencer <rspencer@reidspencer.com>
Mon, 18 Dec 2006 08:16:27 +0000 (08:16 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 18 Dec 2006 08:16:27 +0000 (08:16 +0000)
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

lib/Transforms/ExprTypeConvert.cpp

index 1ce6eedbee3d0db7399c8f8fc3bf814b981d52ac..814318a587e27c01cb4ccb4da8325a301ec1823c 100644 (file)
@@ -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;