diff options
Diffstat (limited to 'clang/lib/AST/RecordLayoutBuilder.cpp')
-rw-r--r-- | clang/lib/AST/RecordLayoutBuilder.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp index ff6b950474d..885d4ff5fb6 100644 --- a/clang/lib/AST/RecordLayoutBuilder.cpp +++ b/clang/lib/AST/RecordLayoutBuilder.cpp @@ -2176,16 +2176,14 @@ MicrosoftRecordLayoutBuilder::getAdjustedElementInfo( Info = getAdjustedElementInfo(Layout); // Nomally getAdjustedElementInfo returns the non-virtual size, which is // correct for bases but not for fields. - Info.Size = Layout.getSize(); + Info.Size = Context.getTypeInfoInChars(FD->getType()).first; // Capture required alignment as a side-effect. RequiredAlignment = std::max(RequiredAlignment, Layout.getRequiredAlignment()); } else { - std::pair<CharUnits, CharUnits> FieldInfo = + llvm::tie(Info.Size, Info.Alignment) = Context.getTypeInfoInChars(FD->getType()); - Info.Size = FieldInfo.first; - Info.Alignment = FieldInfo.second; if (FD->isBitField() && FD->getMaxAlignment() != 0) Info.Alignment = std::max(Info.Alignment, FieldRequiredAlignment); // Respect pragma pack. |