mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 06:32:09 +00:00
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:
parent
848414e49c
commit
8955e3b755
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user