summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-06-22 20:41:57 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-06-22 20:41:57 +0000
commit780c374b2056afb5665377690183cdd50bf97f09 (patch)
tree68e3408917e7c159a9a7b342a4e94e6aec001801
parentd050479be5197b624049a11cbc1308b9268c9540 (diff)
downloadbcm5719-llvm-780c374b2056afb5665377690183cdd50bf97f09.tar.gz
bcm5719-llvm-780c374b2056afb5665377690183cdd50bf97f09.zip
Remove reliance on toCharUnitsFromBits rounding down.
llvm-svn: 364139
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp3
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 =
OpenPOWER on IntegriCloud