From 5f022d82696c84e4d127c558871d68ac6273274e Mon Sep 17 00:00:00 2001 From: Ken Dyck Date: Wed, 9 Feb 2011 01:59:34 +0000 Subject: 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 --- lib/CodeGen/CGExprConstant.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/CodeGen/CGExprConstant.cpp') 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; -- cgit v1.2.3