diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-11 22:39:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-11 22:39:10 +0000 |
commit | 7e85180d15c4d5a451fbc078f7194a41c6230a57 (patch) | |
tree | 40ad0af5702dbbc64ff14cc1225a5431c65c3b37 /lib/MC/MCAsmStreamer.cpp | |
parent | 780679baa7008e54cb94f383c5b13ee995e21fe3 (diff) | |
download | llvm-7e85180d15c4d5a451fbc078f7194a41c6230a57.tar.gz llvm-7e85180d15c4d5a451fbc078f7194a41c6230a57.tar.bz2 llvm-7e85180d15c4d5a451fbc078f7194a41c6230a57.tar.xz |
add a new MCInstPrinter::getOpcodeName interface, when it is
implemented, llvm-mc --show-inst now uses it to print the
instruction opcode as well as the number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAsmStreamer.cpp')
-rw-r--r-- | lib/MC/MCAsmStreamer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 2a8f168f93..6add1b4aba 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -617,6 +617,12 @@ void MCAsmStreamer::EmitInstruction(const MCInst &Inst) { 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); |