Convert RecordLayout::NonVirtualSize from bit units to CharUnits.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124646 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp
index 8c62ffd..7e15dcc 100644
--- a/lib/AST/RecordLayoutBuilder.cpp
+++ b/lib/AST/RecordLayoutBuilder.cpp
@@ -1115,7 +1115,8 @@
if (!Base->Class->isEmpty()) {
// Update the data size.
- DataSize = Offset + Layout.getNonVirtualSize();
+ DataSize = Offset +
+ (Layout.getNonVirtualSize().getQuantity() * Context.getCharWidth());
Size = std::max(Size, DataSize);
} else
@@ -1665,7 +1666,7 @@
new (*this) ASTRecordLayout(*this, Builder->Size, Builder->Alignment,
DataSize, Builder->FieldOffsets.data(),
Builder->FieldOffsets.size(),
- NonVirtualSize,
+ toCharUnitsFromBits(NonVirtualSize),
Builder->NonVirtualAlignment,
EmptySubobjects.SizeOfLargestEmptySubobject,
Builder->PrimaryBase,
@@ -1834,7 +1835,7 @@
OS << " sizeof=" << Layout.getSize() / 8;
OS << ", dsize=" << Layout.getDataSize() / 8;
OS << ", align=" << Layout.getAlignment() / 8 << '\n';
- OS << " nvsize=" << Layout.getNonVirtualSize() / 8;
+ OS << " nvsize=" << Layout.getNonVirtualSize().getQuantity();
OS << ", nvalign=" << Layout.getNonVirtualAlign() / 8 << '\n';
OS << '\n';
}