diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-03-22 21:49:34 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-03-22 21:49:34 +0000 |
commit | 04047fbe1446b160257a2f3949aa4fb2e30dba78 (patch) | |
tree | 061ca8cf0e87b8959626bb853b7fd5b6f444714b /llvm/lib/MC/MCAsmStreamer.cpp | |
parent | 65f7a3f801de0661361c17a71a59c8cf26b465d0 (diff) | |
download | bcm5719-llvm-04047fbe1446b160257a2f3949aa4fb2e30dba78.tar.gz bcm5719-llvm-04047fbe1446b160257a2f3949aa4fb2e30dba78.zip |
MCInst: Add ::dump_pretty.
llvm-svn: 99216
Diffstat (limited to 'llvm/lib/MC/MCAsmStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCAsmStreamer.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp index 2025463a80b..7a23aecf297 100644 --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/lib/MC/MCAsmStreamer.cpp @@ -623,24 +623,10 @@ void MCAsmStreamer::EmitInstruction(const MCInst &Inst) { AddEncodingComment(Inst); // Show the MCInst if enabled. - if (ShowInst) { - raw_ostream &OS = GetCommentOS(); - OS << "<MCInst #" << Inst.getOpcode(); - - StringRef InstName; - if (InstPrinter) - InstName = InstPrinter->getOpcodeName(Inst.getOpcode()); - if (!InstName.empty()) - OS << ' ' << InstName; - - for (unsigned i = 0, e = Inst.getNumOperands(); i != e; ++i) { - OS << "\n "; - Inst.getOperand(i).print(OS, &MAI); - } - OS << ">\n"; - } + if (ShowInst) + Inst.dump_pretty(GetCommentOS(), &MAI, InstPrinter.get(), "\n "); - // If we have an AsmPrinter, use that to print, otherwise dump the MCInst. + // If we have an AsmPrinter, use that to print, otherwise print the MCInst. if (InstPrinter) InstPrinter->printInst(&Inst); else |