make -show-inst be formatted a bit nicer. Before:

movl	$3735928559, a          ## inst: <MCInst 1273 <MCOperand Reg:0> <MCOperand Imm:1> <MCOperand Reg:0> <MCOperand Expr:(a)> <MCOperand Reg:0> <MCOperand Expr:(3735928559)>>

after:

	movl	$3735928559, a          ## <MCInst #1273
                                        ##   <MCOperand Reg:0>
                                        ##   <MCOperand Imm:1>
                                        ##   <MCOperand Reg:0>
                                        ##   <MCOperand Expr:(a)>
                                        ##   <MCOperand Reg:0>
                                        ##   <MCOperand Expr:(3735928559)>>

llvm-svn: 95637
This commit is contained in:
Chris Lattner 2010-02-09 00:54:51 +00:00
parent 48121948dc
commit 89261502cb
1 changed files with 12 additions and 8 deletions

View File

@ -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 << "<MCInst #" << Inst.getOpcode();
for (unsigned i = 0, e = Inst.getNumOperands(); i != e; ++i) {
OS << "\n ";
Inst.getOperand(i).print(OS, &MAI);
}
OS << ">\n";
}
// If we have an AsmPrinter, use that to print, otherwise dump the MCInst.
if (InstPrinter)
InstPrinter->printInst(&Inst);