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 | 780c374b2056afb5665377690183cdd50bf97f09 (patch) | |
tree | 68e3408917e7c159a9a7b342a4e94e6aec001801 /clang/lib/CodeGen/CGExprConstant.cpp | |
parent | d050479be5197b624049a11cbc1308b9268c9540 (diff) | |
download | bcm5719-llvm-780c374b2056afb5665377690183cdd50bf97f09.tar.gz bcm5719-llvm-780c374b2056afb5665377690183cdd50bf97f09.zip |
Remove reliance on toCharUnitsFromBits rounding down.
llvm-svn: 364139
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprConstant.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index 16ccd052255..4a0494295d2 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/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 = |