From dd76a9ab9ea675671200f94b18ce95766841952b Mon Sep 17 00:00:00 2001 From: Ken Dyck Date: Fri, 11 Feb 2011 01:54:29 +0000 Subject: Add a helper function, ASTContext::toBits(), that converts sizes in CharUnits to sizes in bits, and use it to tidy up the places where the conversion was done explicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125332 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprConstant.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/CodeGen/CGExprConstant.cpp') diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index dc84b367cf..c569b37b94 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -394,8 +394,7 @@ bool ConstStructBuilder::Build(InitListExpr *ILE) { } // Append tail padding if necessary. - AppendTailPadding( - Layout.getSize().getQuantity() * CGM.getContext().getCharWidth()); + AppendTailPadding(CGM.getContext().toBits(Layout.getSize())); assert(Layout.getSize().getQuantity() == NextFieldOffsetInBytes && "Tail padding mismatch!"); -- cgit v1.2.3