From 30d9a644d5b09bcf95b8b05ec559c778566265c3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 9 Feb 2010 00:54:51 +0000 Subject: [PATCH] make -show-inst be formatted a bit nicer. Before: movl $3735928559, a ## inst: > after: movl $3735928559, a ## ## ## ## ## ## > git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95637 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCAsmStreamer.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 475e588ec80..d2e48583e02 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -532,14 +532,6 @@ void MCAsmStreamer::EmitDwarfFileDirective(unsigned FileNo, StringRef Filename){ void MCAsmStreamer::EmitInstruction(const MCInst &Inst) { assert(CurSection && "Cannot emit contents before setting section!"); - // Show the MCInst if enabled. - if (ShowInst) { - raw_ostream &OS = GetCommentOS(); - OS << "inst: "; - Inst.print(OS, &MAI); - OS << "\n"; - } - // Show the encoding in a comment if we have a code emitter. if (Emitter) { SmallString<256> Code; @@ -557,6 +549,18 @@ void MCAsmStreamer::EmitInstruction(const MCInst &Inst) { OS << "]\n"; } + // Show the MCInst if enabled. + if (ShowInst) { + raw_ostream &OS = GetCommentOS(); + OS << "\n"; + } + // If we have an AsmPrinter, use that to print, otherwise dump the MCInst. if (InstPrinter) InstPrinter->printInst(&Inst);