r364139 - Remove reliance on toCharUnitsFromBits rounding down.
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Sat Jun 22 13:41:57 PDT 2019
Author: rsmith
Date: Sat Jun 22 13:41:57 2019
New Revision: 364139
URL: http://llvm.org/viewvc/llvm-project?rev=364139&view=rev
Log:
Remove reliance on toCharUnitsFromBits rounding down.
Modified:
cfe/trunk/lib/CodeGen/CGExprConstant.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=364139&r1=364138&r2=364139&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Sat Jun 22 13:41:57 2019
@@ -187,7 +187,8 @@ bool ConstantAggregateBuilder::addBits(l
// 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 =
More information about the cfe-commits
mailing list