Skip to content

Commit 124ae13

Browse files
author
Devang Patel
committed
Hoist MCLineEntry construction AsmPrinter so that anyone who derives from AsmPrinter can have line number entries.
PR 9810 llvm-svn: 130518
1 parent dc3e4cc commit 124ae13

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,9 @@ void AsmPrinter::EmitFunctionBody() {
691691
if (isVerbose()) EmitKill(II, *this);
692692
break;
693693
default:
694+
if (!TM.hasMCUseLoc())
695+
MCLineEntry::Make(&OutStreamer, getCurrentSection());
696+
694697
EmitInstruction(II);
695698
break;
696699
}

llvm/lib/MC/MCAsmStreamer.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -957,9 +957,6 @@ void MCAsmStreamer::EmitRegSave(const SmallVectorImpl<unsigned> &RegList,
957957
void MCAsmStreamer::EmitInstruction(const MCInst &Inst) {
958958
assert(getCurrentSection() && "Cannot emit contents before setting section!");
959959

960-
if (!UseLoc)
961-
MCLineEntry::Make(this, getCurrentSection());
962-
963960
// Show the encoding in a comment if we have a code emitter.
964961
if (Emitter)
965962
AddEncodingComment(Inst);

0 commit comments

Comments
 (0)