Unclutter this by using new cast creation functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32192 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2006-12-04 20:18:26 +00:00
parent 848414e49c
commit 8955e3b755

View File

@ -115,18 +115,12 @@ namespace llvm {
Value *visitTruncateExpr(SCEVTruncateExpr *S) {
Value *V = expand(S->getOperand());
Instruction::CastOps Opcode = (V->getType()->getPrimitiveSizeInBits() ==
S->getType()->getPrimitiveSizeInBits()) ? Instruction::BitCast :
Instruction::Trunc;
return CastInst::create(Opcode, V, S->getType(), "tmp.", InsertPt);
return CastInst::createTruncOrBitCast(V, S->getType(), "tmp.", InsertPt);
}
Value *visitZeroExtendExpr(SCEVZeroExtendExpr *S) {
Value *V = expandInTy(S->getOperand(),S->getType()->getUnsignedVersion());
Instruction::CastOps Opcode = (V->getType()->getPrimitiveSizeInBits() ==
S->getType()->getPrimitiveSizeInBits()) ? Instruction::BitCast :
Instruction::ZExt;
return CastInst::create(Opcode, V, S->getType(), "tmp.", InsertPt);
return CastInst::createZExtOrBitCast(V, S->getType(), "tmp.", InsertPt);
}
Value *visitAddExpr(SCEVAddExpr *S) {