aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/ScalarEvolutionExpander.h
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-04 20:18:26 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-04 20:18:26 +0000
commit8955e3b755b2337423911d8c3e0fd6ab36036912 (patch)
tree818700cf6ad238fff046d4ab6cb0097367cdd6cd /include/llvm/Analysis/ScalarEvolutionExpander.h
parent848414e49c7600e3002a4366de52d03a9638b327 (diff)
downloadexternal_llvm-8955e3b755b2337423911d8c3e0fd6ab36036912.zip
external_llvm-8955e3b755b2337423911d8c3e0fd6ab36036912.tar.gz
external_llvm-8955e3b755b2337423911d8c3e0fd6ab36036912.tar.bz2
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
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolutionExpander.h')
-rw-r--r--include/llvm/Analysis/ScalarEvolutionExpander.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h
index 7f0f96f..c3ea383 100644
--- a/include/llvm/Analysis/ScalarEvolutionExpander.h
+++ b/include/llvm/Analysis/ScalarEvolutionExpander.h
@@ -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) {