diff --git a/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.cpp b/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.cpp index 6eeb797db5722..5ecf7fe2bbe54 100644 --- a/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.cpp +++ b/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.cpp @@ -59,6 +59,13 @@ void Dump(MCObjectStreamer *Streamer, uint16_t DwarfVersion, unsigned TargetPoin dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, 0, 0, + EnumerationTypeNoChildren, + dwarf::DW_TAG_enumeration_type, dwarf::DW_CHILDREN_no, + dwarf::DW_AT_name, dwarf::DW_FORM_strp, + dwarf::DW_AT_type, dwarf::DW_FORM_ref4, + dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, + 0, 0, + Enumerator1, dwarf::DW_TAG_enumerator, dwarf::DW_CHILDREN_no, dwarf::DW_AT_name, dwarf::DW_FORM_strp, diff --git a/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.h b/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.h index 448123c99a92d..ce447ac64d1f9 100644 --- a/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.h +++ b/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.h @@ -21,6 +21,7 @@ enum DwarfAbbrev : uint16_t CompileUnit = 0x1, BaseType, EnumerationType, + EnumerationTypeNoChildren, Enumerator1, Enumerator2, Enumerator4, diff --git a/llvm/tools/objwriter/debugInfo/dwarf/dwarfTypeBuilder.cpp b/llvm/tools/objwriter/debugInfo/dwarf/dwarfTypeBuilder.cpp index ff4ab03e6c9bb..ba0007c93a9cb 100644 --- a/llvm/tools/objwriter/debugInfo/dwarf/dwarfTypeBuilder.cpp +++ b/llvm/tools/objwriter/debugInfo/dwarf/dwarfTypeBuilder.cpp @@ -282,7 +282,7 @@ void DwarfEnumTypeInfo::DumpStrings(MCObjectStreamer *Streamer) { void DwarfEnumTypeInfo::DumpTypeInfo(MCObjectStreamer *Streamer, UserDefinedDwarfTypesBuilder *TypeBuilder) { // Abbrev Number - Streamer->emitULEB128IntValue(DwarfAbbrev::EnumerationType); + Streamer->emitULEB128IntValue(HasChildren() ? DwarfAbbrev::EnumerationType : DwarfAbbrev::EnumerationTypeNoChildren); // DW_AT_name EmitSectionOffset(Streamer, StrSymbol, 4);