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
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp
index dc84b36..c569b37 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/lib/CodeGen/CGExprConstant.cpp
@@ -394,8 +394,7 @@
   }
 
   // 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!");