@@ -2057,14 +2057,6 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
20572057 }
20582058 }
20592059
2060- auto RecordSourceLine = [&](auto &DL, auto Flags) {
2061- SmallString<128 > LocationString;
2062- raw_svector_ostream OS (LocationString);
2063- DL.print (OS);
2064-
2065- const MDNode *Scope = DL.getScope ();
2066- recordSourceLine (DL.getLine (), DL.getCol (), Scope, Flags, LocationString);
2067- };
20682060 // When we emit a line-0 record, we don't update PrevInstLoc; so look at
20692061 // the last line number actually emitted, to see if it was line 0.
20702062 unsigned LastAsmLine =
@@ -2092,7 +2084,8 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
20922084 // But we might be coming back to it after a line 0 record.
20932085 if ((LastAsmLine == 0 && DL.getLine () != 0 ) || Flags) {
20942086 // Reinstate the source location but not marked as a statement.
2095- RecordSourceLine (DL, Flags);
2087+ const MDNode *Scope = DL.getScope ();
2088+ recordSourceLine (DL.getLine (), DL.getCol (), Scope, Flags);
20962089 }
20972090 return ;
20982091 }
@@ -2143,7 +2136,8 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
21432136 if (DL.getLine () && (DL.getLine () != OldLine || ForceIsStmt))
21442137 Flags |= DWARF2_FLAG_IS_STMT;
21452138
2146- RecordSourceLine (DL, Flags);
2139+ const MDNode *Scope = DL.getScope ();
2140+ recordSourceLine (DL.getLine (), DL.getCol (), Scope, Flags);
21472141
21482142 // If we're not at line 0, remember this location.
21492143 if (DL.getLine ())
@@ -2278,8 +2272,7 @@ findPrologueEndLoc(const MachineFunction *MF) {
22782272static void recordSourceLine (AsmPrinter &Asm, unsigned Line, unsigned Col,
22792273 const MDNode *S, unsigned Flags, unsigned CUID,
22802274 uint16_t DwarfVersion,
2281- ArrayRef<std::unique_ptr<DwarfCompileUnit>> DCUs,
2282- StringRef Comment = {}) {
2275+ ArrayRef<std::unique_ptr<DwarfCompileUnit>> DCUs) {
22832276 StringRef Fn;
22842277 unsigned FileNo = 1 ;
22852278 unsigned Discriminator = 0 ;
@@ -2293,7 +2286,7 @@ static void recordSourceLine(AsmPrinter &Asm, unsigned Line, unsigned Col,
22932286 .getOrCreateSourceID (Scope->getFile ());
22942287 }
22952288 Asm.OutStreamer ->emitDwarfLocDirective (FileNo, Line, Col, Flags, 0 ,
2296- Discriminator, Fn, Comment );
2289+ Discriminator, Fn);
22972290}
22982291
22992292const MachineInstr *
@@ -2624,10 +2617,10 @@ void DwarfDebug::endFunctionImpl(const MachineFunction *MF) {
26242617// Register a source line with debug info. Returns the unique label that was
26252618// emitted and which provides correspondence to the source line list.
26262619void DwarfDebug::recordSourceLine (unsigned Line, unsigned Col, const MDNode *S,
2627- unsigned Flags, StringRef Location ) {
2620+ unsigned Flags) {
26282621 ::recordSourceLine (*Asm, Line, Col, S, Flags,
26292622 Asm->OutStreamer->getContext ().getDwarfCompileUnitID(),
2630- getDwarfVersion(), getUnits(), Location );
2623+ getDwarfVersion(), getUnits());
26312624}
26322625
26332626// ===----------------------------------------------------------------------===//
0 commit comments