[llvm-commits] CVS: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
Reid Spencer
reid at x10sys.com
Mon Dec 4 12:18:41 PST 2006
Changes in directory llvm/include/llvm/Analysis:
ScalarEvolutionExpander.h updated: 1.8 -> 1.9
---
Log message:
Unclutter this by using new cast creation functions.
---
Diffs of the changes: (+2 -8)
ScalarEvolutionExpander.h | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
Index: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
diff -u llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.8 llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.9
--- llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.8 Sun Dec 3 20:44:57 2006
+++ llvm/include/llvm/Analysis/ScalarEvolutionExpander.h Mon Dec 4 14:18:26 2006
@@ -115,18 +115,12 @@
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) {
More information about the llvm-commits
mailing list