From 49a3ff9d1733cb16bdc97590e5b90508b8656565 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Fri, 29 Apr 2011 18:00:54 +0000 Subject: [PATCH] Hoist MCLineEntry construction AsmPrinter so that anyone who derives from AsmPrinter can have line number entries. PR 9810 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130518 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 3 +++ lib/MC/MCAsmStreamer.cpp | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 549bdcb6687..8116f8d5925 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -691,6 +691,9 @@ void AsmPrinter::EmitFunctionBody() { if (isVerbose()) EmitKill(II, *this); break; default: + if (!TM.hasMCUseLoc()) + MCLineEntry::Make(&OutStreamer, getCurrentSection()); + EmitInstruction(II); break; } diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 2f8297725e7..23ddebd3cfd 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -957,9 +957,6 @@ void MCAsmStreamer::EmitRegSave(const SmallVectorImpl &RegList, void MCAsmStreamer::EmitInstruction(const MCInst &Inst) { assert(getCurrentSection() && "Cannot emit contents before setting section!"); - if (!UseLoc) - MCLineEntry::Make(this, getCurrentSection()); - // Show the encoding in a comment if we have a code emitter. if (Emitter) AddEncodingComment(Inst);