diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-06-22 20:41:57 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-06-22 20:41:57 +0000 |
| commit | a77e890312b9c1fbf2cf4c7a736dfc13c7fa623c (patch) | |
| tree | dcb34f82b206473357a369f1130446f3dafdc1b2 /lib/CodeGen/CGExprConstant.cpp | |
| parent | 536cc1bb17e0b16909bea559425a896539147c61 (diff) | |
| download | clang-a77e890312b9c1fbf2cf4c7a736dfc13c7fa623c.tar.gz | |
Remove reliance on toCharUnitsFromBits rounding down.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364139 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
| -rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 16ccd05225..4a0494295d 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -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 = |
