summaryrefslogtreecommitdiff
path: root/lib/MC/MCAsmStreamer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-11 22:39:10 +0000
committerChris Lattner <sabre@nondot.org>2010-02-11 22:39:10 +0000
commit7e85180d15c4d5a451fbc078f7194a41c6230a57 (patch)
tree40ad0af5702dbbc64ff14cc1225a5431c65c3b37 /lib/MC/MCAsmStreamer.cpp
parent780679baa7008e54cb94f383c5b13ee995e21fe3 (diff)
downloadllvm-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.cpp6
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);