: Out(O), CurBit(0), CurValue(0), CurCodeSize(2) {}
~BitstreamWriter() {
- assert(CurBit == 0 && "Unflused data remaining");
+ assert(CurBit == 0 && "Unflushed data remaining");
assert(BlockScope.empty() && CurAbbrevs.empty() && "Block imbalance");
// Free the BlockInfoRecords.
i != e; ++i)
if (BlockInfoRecords[i].BlockID == BlockID)
return &BlockInfoRecords[i];
- return 0;
+ return nullptr;
}
void EnterSubblock(unsigned BlockID, unsigned CodeLen) {
EmitAbbreviatedField(EltEnc, (unsigned char)BlobData[i]);
// Know that blob data is consumed for assertion below.
- BlobData = 0;
+ BlobData = nullptr;
} else {
// Emit a vbr6 to indicate the number of elements present.
EmitVBR(static_cast<uint32_t>(Vals.size()-RecordIdx), 6);
WriteByte((unsigned char)BlobData[i]);
// Know that blob data is consumed for assertion below.
- BlobData = 0;
+ BlobData = nullptr;
} 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]);
}
}
}
}
assert(RecordIdx == Vals.size() && "Not all record operands emitted!");
- assert(BlobData == 0 &&
+ assert(BlobData == nullptr &&
"Blob data specified for record that doesn't use it!");
}
template<typename uintty>
void EmitRecordWithArray(unsigned Abbrev, SmallVectorImpl<uintty> &Vals,
const char *ArrayData, unsigned ArrayLen) {
- return EmitRecordWithAbbrevImpl(Abbrev, Vals, StringRef(ArrayData,
+ return EmitRecordWithAbbrevImpl(Abbrev, Vals, StringRef(ArrayData,
ArrayLen));
}