aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-09 00:54:51 +0000
committerChris Lattner <sabre@nondot.org>2010-02-09 00:54:51 +0000
commit30d9a644d5b09bcf95b8b05ec559c778566265c3 (patch)
tree59b65b17dd8e44fcb15865f5afa62dd71f56fc7c
parent0b23dc0cc8fb2967dc08574910536cc074863bcb (diff)
downloadexternal_llvm-30d9a644d5b09bcf95b8b05ec559c778566265c3.tar.gz
external_llvm-30d9a644d5b09bcf95b8b05ec559c778566265c3.tar.bz2
external_llvm-30d9a644d5b09bcf95b8b05ec559c778566265c3.zip
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)>> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95637 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/MC/MCAsmStreamer.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index 475e588ec8..d2e48583e0 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 << "<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);