================ @@ -1926,12 +1930,13 @@ DWARFASTParserClang::ParseStructureLikeDIE(const SymbolContext &sc, // TypeSystemClang is always in C++ mode, but some compilers such as // GCC and Clang give empty structs a size of 0 in C mode (in contrast to // the size of 1 for empty structs that would be computed in C++ mode). - if (attrs.byte_size) { + if (attrs.byte_size || attrs.alignment) { clang::RecordDecl *record_decl = TypeSystemClang::GetAsRecordDecl(clang_type); if (record_decl) { ClangASTImporter::LayoutInfo layout; - layout.bit_size = *attrs.byte_size * 8; + layout.bit_size = attrs.byte_size.value_or(0) * 8; + layout.alignment = attrs.alignment.value_or(0) * 8; ---------------- Michael137 wrote:
Why do we need this extra accounting for alignment here? This block used to be solely for cases where empty structs had special byte-size requirements. Is it because in your tests `alignof(EmptyStruct)` wouldn't trigger `CompleteRecordType`? https://github.com/llvm/llvm-project/pull/73307 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits