aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
authorKen Dyck <kd@kendyck.com>2011-02-09 01:59:34 +0000
committerKen Dyck <kd@kendyck.com>2011-02-09 01:59:34 +0000
commit5f022d82696c84e4d127c558871d68ac6273274e (patch)
tree1116084da52ffdcc50f243868be92d98053494c1 /lib/CodeGen/CGExprConstant.cpp
parentd767d81290288c030f3be0be1d3e62b9c8df51dc (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.cpp7
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;