From b0fcc59e19508dca2dc809fb5c83e19c4d3e9ffc 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. llvm-svn: 125332 --- clang/lib/CodeGen/CGExprConstant.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CGExprConstant.cpp') diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index dc84b367cf0..c569b37b946 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/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