diff options
author | Ken Dyck <kd@kendyck.com> | 2011-02-09 01:59:34 +0000 |
---|---|---|
committer | Ken Dyck <kd@kendyck.com> | 2011-02-09 01:59:34 +0000 |
commit | 5f022d82696c84e4d127c558871d68ac6273274e (patch) | |
tree | 1116084da52ffdcc50f243868be92d98053494c1 /lib/CodeGen/CGExprConstant.cpp | |
parent | d767d81290288c030f3be0be1d3e62b9c8df51dc (diff) |
Convert RecordLayout::Size to CharUnits from bits. No changes to
functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125156 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 4d8a60e1e8..dc84b367cf 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -368,7 +368,7 @@ bool ConstStructBuilder::Build(InitListExpr *ILE) { } } - uint64_t LayoutSizeInBytes = Layout.getSize() / 8; + uint64_t LayoutSizeInBytes = Layout.getSize().getQuantity(); if (NextFieldOffsetInBytes > LayoutSizeInBytes) { // If the struct is bigger than the size of the record type, @@ -394,9 +394,10 @@ bool ConstStructBuilder::Build(InitListExpr *ILE) { } // Append tail padding if necessary. - AppendTailPadding(Layout.getSize()); + AppendTailPadding( + Layout.getSize().getQuantity() * CGM.getContext().getCharWidth()); - assert(Layout.getSize() / 8 == NextFieldOffsetInBytes && + assert(Layout.getSize().getQuantity() == NextFieldOffsetInBytes && "Tail padding mismatch!"); return true; |