aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/ConstantFold.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-12 23:36:14 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-12 23:36:14 +0000
commitd977d8651a5cd26a3e1088267f31cade405f2adf (patch)
tree56a269fe411951fa288d6a08c32f3d74b8bf8794 /lib/VMCore/ConstantFold.cpp
parentebc0922eeb5b728d33a68d4bea8128413f62e369 (diff)
Replace inferred getCast(V,Ty) calls with more strict variants.
Rename getZeroExtend and getSignExtend to getZExt and getSExt to match the the casting mnemonics in the rest of LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32514 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r--lib/VMCore/ConstantFold.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index bad774e67f..170df73272 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -743,8 +743,7 @@ static Constant *CastConstantPacked(ConstantPacked *CP,
(SrcEltTy->isFloatingPoint() && DstEltTy->isFloatingPoint())) {
for (unsigned i = 0; i != SrcNumElts; ++i)
Result.push_back(
- ConstantExpr::getCast(Instruction::BitCast, CP->getOperand(i),
- DstEltTy));
+ ConstantExpr::getBitCast(CP->getOperand(i), DstEltTy));
return ConstantPacked::get(Result);
}
@@ -1148,11 +1147,11 @@ static int IdxCompare(Constant *C1, Constant *C2, const Type *ElTy) {
// Ok, we have two differing integer indices. Sign extend them to be the same
// type. Long is always big enough, so we use it.
if (C1->getType() != Type::LongTy && C1->getType() != Type::ULongTy)
- C1 = ConstantExpr::getSignExtend(C1, Type::LongTy);
+ C1 = ConstantExpr::getSExt(C1, Type::LongTy);
else
C1 = ConstantExpr::getBitCast(C1, Type::LongTy);
if (C2->getType() != Type::LongTy && C1->getType() != Type::ULongTy)
- C2 = ConstantExpr::getSignExtend(C2, Type::LongTy);
+ C2 = ConstantExpr::getSExt(C2, Type::LongTy);
else
C2 = ConstantExpr::getBitCast(C2, Type::LongTy);
@@ -1672,7 +1671,7 @@ Constant *llvm::ConstantFoldGetElementPtr(const Constant *C,
R = ConstantExpr::getSExtOrBitCast(R, Idx0->getType());
R = ConstantExpr::getMul(R, Idx0); // signed multiply
// R is a signed integer, C is the GEP pointer so -> IntToPtr
- return ConstantExpr::getCast(Instruction::IntToPtr, R, C->getType());
+ return ConstantExpr::getIntToPtr(R, C->getType());
}
}
}