Fixing -Wsign-compare warnings; NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224337 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Aaron Ballman 2014-12-16 14:04:11 +00:00
parent 9e8621e99a
commit 51c2bdca72
3 changed files with 6 additions and 3 deletions

View File

@ -1492,7 +1492,8 @@ void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalObject *GV) const {
if (NumBits == 0) return; // 1-byte aligned: no need to emit alignment.
assert(NumBits < std::numeric_limits<unsigned>::digits &&
assert(NumBits <
static_cast<unsigned>(std::numeric_limits<unsigned>::digits) &&
"undefined behavior");
if (getCurrentSection()->getKind().isText())
OutStreamer.EmitCodeAlignment(1u << NumBits);

View File

@ -74,7 +74,8 @@ struct DomainValue {
// Is domain available?
bool hasDomain(unsigned domain) const {
assert(domain < std::numeric_limits<unsigned>::digits &&
assert(domain <
static_cast<unsigned>(std::numeric_limits<unsigned>::digits) &&
"undefined behavior");
return AvailableDomains & (1u << domain);
}

View File

@ -8577,7 +8577,8 @@ static SDValue PerformBFICombine(SDNode *N,
unsigned InvMask = cast<ConstantSDNode>(N->getOperand(2))->getZExtValue();
unsigned LSB = countTrailingZeros(~InvMask);
unsigned Width = (32 - countLeadingZeros(~InvMask)) - LSB;
assert(Width < std::numeric_limits<unsigned>::digits &&
assert(Width <
static_cast<unsigned>(std::numeric_limits<unsigned>::digits) &&
"undefined behavior");
unsigned Mask = (1u << Width) - 1;
unsigned Mask2 = N11C->getZExtValue();