diff --git a/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.cpp b/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.cpp index 362d5df76017bd..9d54a3a6cba6d6 100644 --- a/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.cpp +++ b/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.cpp @@ -125,6 +125,17 @@ void Dump(MCObjectStreamer *Streamer, uint16_t DwarfVersion, unsigned TargetPoin dwarf::DW_AT_declaration, dwarf::DW_FORM_flag_present, 0, 0, + SubprogramStaticNoChildrenSpec, + dwarf::DW_TAG_subprogram, dwarf::DW_CHILDREN_no, + dwarf::DW_AT_name, dwarf::DW_FORM_strp, + dwarf::DW_AT_linkage_name, dwarf::DW_FORM_strp, + dwarf::DW_AT_decl_file, dwarf::DW_FORM_data1, + dwarf::DW_AT_decl_line, dwarf::DW_FORM_data1, + dwarf::DW_AT_type, dwarf::DW_FORM_ref4, + dwarf::DW_AT_external, dwarf::DW_FORM_flag_present, + dwarf::DW_AT_declaration, dwarf::DW_FORM_flag_present, + 0, 0, + Variable, dwarf::DW_TAG_variable, 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 3cd8cea23772cc..1a79930824c150 100644 --- a/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.h +++ b/llvm/tools/objwriter/debugInfo/dwarf/dwarfAbbrev.h @@ -30,6 +30,7 @@ enum DwarfAbbrev : uint16_t SubprogramStatic, SubprogramSpec, SubprogramStaticSpec, + SubprogramStaticNoChildrenSpec, Variable, VariableLoc, VariableStatic, diff --git a/llvm/tools/objwriter/debugInfo/dwarf/dwarfTypeBuilder.cpp b/llvm/tools/objwriter/debugInfo/dwarf/dwarfTypeBuilder.cpp index 6d663e05128844..4fd35c48c2f6ec 100644 --- a/llvm/tools/objwriter/debugInfo/dwarf/dwarfTypeBuilder.cpp +++ b/llvm/tools/objwriter/debugInfo/dwarf/dwarfTypeBuilder.cpp @@ -601,8 +601,12 @@ void DwarfMemberFunctionIdTypeInfo::DumpStrings(MCObjectStreamer *Streamer) { void DwarfMemberFunctionIdTypeInfo::DumpTypeInfo(MCObjectStreamer *Streamer, UserDefinedDwarfTypesBuilder *TypeBuilder) { // Abbrev Number bool IsStatic = MemberFunctionTypeInfo->IsStatic(); + bool HasParameters = MemberFunctionTypeInfo->GetArgTypes().size(); - Streamer->emitULEB128IntValue(IsStatic ? DwarfAbbrev::SubprogramStaticSpec : DwarfAbbrev::SubprogramSpec); + Streamer->emitULEB128IntValue( + IsStatic ? (HasParameters ? DwarfAbbrev::SubprogramStaticSpec + : DwarfAbbrev::SubprogramStaticNoChildrenSpec) + : DwarfAbbrev::SubprogramSpec); // DW_AT_name EmitSectionOffset(Streamer, StrSymbol, 4);