Remove reliance on toCharUnitsFromBits rounding down.

llvm-svn: 364139
This commit is contained in:
Richard Smith 2019-06-22 20:41:57 +00:00
parent d050479be5
commit 780c374b20
1 changed files with 2 additions and 1 deletions

View File

@ -187,7 +187,8 @@ bool ConstantAggregateBuilder::addBits(llvm::APInt Bits, uint64_t OffsetInBits,
// We split bit-fields up into individual bytes. Walk over the bytes and
// update them.
for (CharUnits OffsetInChars = Context.toCharUnitsFromBits(OffsetInBits);
for (CharUnits OffsetInChars =
Context.toCharUnitsFromBits(OffsetInBits - OffsetWithinChar);
/**/; ++OffsetInChars) {
// Number of bits we want to fill in this char.
unsigned WantedBits =