This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1e7ec4842c1a: [AST] Get field size in chars rather than bits in RecordLayoutBuilder. (authored by ebevhan).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85191/new/ https://reviews.llvm.org/D85191 Files: clang/lib/AST/RecordLayoutBuilder.cpp Index: clang/lib/AST/RecordLayoutBuilder.cpp =================================================================== --- clang/lib/AST/RecordLayoutBuilder.cpp +++ clang/lib/AST/RecordLayoutBuilder.cpp @@ -1838,14 +1838,13 @@ CharUnits EffectiveFieldSize; auto setDeclInfo = [&](bool IsIncompleteArrayType) { - TypeInfo TI = Context.getTypeInfo(D->getType()); - FieldAlign = Context.toCharUnitsFromBits(TI.Align); + auto TI = Context.getTypeInfoInChars(D->getType()); + FieldAlign = TI.second; // Flexible array members don't have any size, but they have to be // aligned appropriately for their element type. EffectiveFieldSize = FieldSize = - IsIncompleteArrayType ? CharUnits::Zero() - : Context.toCharUnitsFromBits(TI.Width); - AlignIsRequired = TI.AlignIsRequired; + IsIncompleteArrayType ? CharUnits::Zero() : TI.first; + AlignIsRequired = Context.getTypeInfo(D->getType()).AlignIsRequired; }; if (D->getType()->isIncompleteArrayType()) {
Index: clang/lib/AST/RecordLayoutBuilder.cpp =================================================================== --- clang/lib/AST/RecordLayoutBuilder.cpp +++ clang/lib/AST/RecordLayoutBuilder.cpp @@ -1838,14 +1838,13 @@ CharUnits EffectiveFieldSize; auto setDeclInfo = [&](bool IsIncompleteArrayType) { - TypeInfo TI = Context.getTypeInfo(D->getType()); - FieldAlign = Context.toCharUnitsFromBits(TI.Align); + auto TI = Context.getTypeInfoInChars(D->getType()); + FieldAlign = TI.second; // Flexible array members don't have any size, but they have to be // aligned appropriately for their element type. EffectiveFieldSize = FieldSize = - IsIncompleteArrayType ? CharUnits::Zero() - : Context.toCharUnitsFromBits(TI.Width); - AlignIsRequired = TI.AlignIsRequired; + IsIncompleteArrayType ? CharUnits::Zero() : TI.first; + AlignIsRequired = Context.getTypeInfo(D->getType()).AlignIsRequired; }; if (D->getType()->isIncompleteArrayType()) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits