Eliminate use of uint32_t to improve compatibility with cygwin

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62590 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-01-20 18:22:57 +00:00
parent ce31b027e7
commit 79abedb83a

View File

@ -50,7 +50,7 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
TargetData *TD, unsigned Depth) { TargetData *TD, unsigned Depth) {
assert(V && "No Value?"); assert(V && "No Value?");
assert(Depth <= 6 && "Limit Search Depth"); assert(Depth <= 6 && "Limit Search Depth");
uint32_t BitWidth = Mask.getBitWidth(); unsigned BitWidth = Mask.getBitWidth();
assert((V->getType()->isInteger() || isa<PointerType>(V->getType())) && assert((V->getType()->isInteger() || isa<PointerType>(V->getType())) &&
"Not integer or pointer type!"); "Not integer or pointer type!");
assert((!TD || TD->getTypeSizeInBits(V->getType()) == BitWidth) && assert((!TD || TD->getTypeSizeInBits(V->getType()) == BitWidth) &&
@ -215,7 +215,7 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
// Note that we handle pointer operands here because of inttoptr/ptrtoint // Note that we handle pointer operands here because of inttoptr/ptrtoint
// which fall through here. // which fall through here.
const Type *SrcTy = I->getOperand(0)->getType(); const Type *SrcTy = I->getOperand(0)->getType();
uint32_t SrcBitWidth = TD ? unsigned SrcBitWidth = TD ?
TD->getTypeSizeInBits(SrcTy) : TD->getTypeSizeInBits(SrcTy) :
SrcTy->getPrimitiveSizeInBits(); SrcTy->getPrimitiveSizeInBits();
APInt MaskIn(Mask); APInt MaskIn(Mask);
@ -243,7 +243,7 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
case Instruction::SExt: { case Instruction::SExt: {
// Compute the bits in the result that are not present in the input. // Compute the bits in the result that are not present in the input.
const IntegerType *SrcTy = cast<IntegerType>(I->getOperand(0)->getType()); const IntegerType *SrcTy = cast<IntegerType>(I->getOperand(0)->getType());
uint32_t SrcBitWidth = SrcTy->getBitWidth(); unsigned SrcBitWidth = SrcTy->getBitWidth();
APInt MaskIn(Mask); APInt MaskIn(Mask);
MaskIn.trunc(SrcBitWidth); MaskIn.trunc(SrcBitWidth);
@ -403,7 +403,7 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
ComputeMaskedBits(I->getOperand(1), AllOnes, KnownZero2, KnownOne2, ComputeMaskedBits(I->getOperand(1), AllOnes, KnownZero2, KnownOne2,
TD, Depth+1); TD, Depth+1);
uint32_t Leaders = std::max(KnownZero.countLeadingOnes(), unsigned Leaders = std::max(KnownZero.countLeadingOnes(),
KnownZero2.countLeadingOnes()); KnownZero2.countLeadingOnes());
KnownOne.clear(); KnownOne.clear();
KnownZero = APInt::getHighBitsSet(BitWidth, Leaders) & Mask; KnownZero = APInt::getHighBitsSet(BitWidth, Leaders) & Mask;
@ -465,8 +465,8 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
ComputeMaskedBits(Index, LocalMask, ComputeMaskedBits(Index, LocalMask,
LocalKnownZero, LocalKnownOne, TD, Depth+1); LocalKnownZero, LocalKnownOne, TD, Depth+1);
TrailZ = std::min(TrailZ, TrailZ = std::min(TrailZ,
CountTrailingZeros_64(TypeSize) + unsigned(CountTrailingZeros_64(TypeSize) +
LocalKnownZero.countTrailingOnes()); LocalKnownZero.countTrailingOnes()));
} }
} }