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
This commit is contained in:
Devang Patel 2011-04-29 18:00:54 +00:00
parent 0eab5c4d85
commit 49a3ff9d17
2 changed files with 3 additions and 3 deletions

View File

@ -691,6 +691,9 @@ void AsmPrinter::EmitFunctionBody() {
if (isVerbose()) EmitKill(II, *this);
break;
default:
if (!TM.hasMCUseLoc())
MCLineEntry::Make(&OutStreamer, getCurrentSection());
EmitInstruction(II);
break;
}

View File

@ -957,9 +957,6 @@ void MCAsmStreamer::EmitRegSave(const SmallVectorImpl<unsigned> &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);