BitstreamWriter asserts that when blob data is written from the record
element vector, each element fits in a byte. However, if the record
elements are specified as a SmallVector of 'char', this causes a warning
from -Wtautological-constant-out-of-range-compare. Fix this by using
llvm::isUInt<8> instead of a plain comparison against 256.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181545
91177308-0d34-0410-b5e6-
96231b3b80d8
BlobData = 0;
} else {
for (unsigned e = Vals.size(); RecordIdx != e; ++RecordIdx) {
- assert(Vals[RecordIdx] < 256 && "Value too large to emit as blob");
+ assert(isUInt<8>(Vals[RecordIdx]) &&
+ "Value too large to emit as blob");
WriteByte((unsigned char)Vals[RecordIdx]);
}
}