diff --git a/llvm/include/llvm/MC/MCDwarf.h b/llvm/include/llvm/MC/MCDwarf.h --- a/llvm/include/llvm/MC/MCDwarf.h +++ b/llvm/include/llvm/MC/MCDwarf.h @@ -43,7 +43,7 @@ namespace mcdwarf { // Emit the common part of the DWARF 5 range/locations list tables header. -void emitListsTableHeaderStart(MCStreamer *S, MCSymbol *TableStart, +void emitListsTableHeaderStart(MCStreamer &S, MCSymbol *TableStart, MCSymbol *TableEnd); } // namespace mcdwarf diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2407,8 +2407,7 @@ const DwarfFile &Holder) { MCSymbol *TableStart = Asm->createTempSymbol("debug_rnglist_table_start"); MCSymbol *TableEnd = Asm->createTempSymbol("debug_rnglist_table_end"); - mcdwarf::emitListsTableHeaderStart(Asm->OutStreamer.get(), TableStart, - TableEnd); + mcdwarf::emitListsTableHeaderStart(*Asm->OutStreamer, TableStart, TableEnd); Asm->OutStreamer->AddComment("Offset entry count"); Asm->emitInt32(Holder.getRangeLists().size()); @@ -2427,8 +2426,7 @@ const DwarfDebug &DD) { MCSymbol *TableStart = Asm->createTempSymbol("debug_loclist_table_start"); MCSymbol *TableEnd = Asm->createTempSymbol("debug_loclist_table_end"); - mcdwarf::emitListsTableHeaderStart(Asm->OutStreamer.get(), TableStart, - TableEnd); + mcdwarf::emitListsTableHeaderStart(*Asm->OutStreamer, TableStart, TableEnd); const auto &DebugLocs = DD.getDebugLocs(); diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -45,17 +45,17 @@ using namespace llvm; -void mcdwarf::emitListsTableHeaderStart(MCStreamer *S, MCSymbol *TableStart, +void mcdwarf::emitListsTableHeaderStart(MCStreamer &S, MCSymbol *TableStart, MCSymbol *TableEnd) { - S->AddComment("Length"); - S->emitAbsoluteSymbolDiff(TableEnd, TableStart, 4); - S->emitLabel(TableStart); - S->AddComment("Version"); - S->emitInt16(S->getContext().getDwarfVersion()); - S->AddComment("Address size"); - S->emitInt8(S->getContext().getAsmInfo()->getCodePointerSize()); - S->AddComment("Segment selector size"); - S->emitInt8(0); + S.AddComment("Length"); + S.emitAbsoluteSymbolDiff(TableEnd, TableStart, 4); + S.emitLabel(TableStart); + S.AddComment("Version"); + S.emitInt16(S.getContext().getDwarfVersion()); + S.AddComment("Address size"); + S.emitInt8(S.getContext().getAsmInfo()->getCodePointerSize()); + S.AddComment("Segment selector size"); + S.emitInt8(0); } /// Manage the .debug_line_str section contents, if we use it. @@ -1121,7 +1121,7 @@ context.createTempSymbol("debug_rnglists_start", true, true); MCSymbol *EndSymbol = context.createTempSymbol("debug_rnglists_end", true, true); - mcdwarf::emitListsTableHeaderStart(MCOS, StartSymbol, EndSymbol); + mcdwarf::emitListsTableHeaderStart(*MCOS, StartSymbol, EndSymbol); MCOS->AddComment("Offset entry count"); MCOS->emitInt32(0); RangesSymbol = context.createTempSymbol("debug_rnglist0_start", true, true);