summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit524138176df588fdd466e66986df08d4d32918bd (patch)
tree581e56d34b59db890c9fe2dc55180c354f0457c3 /llvm/lib/MC/MCAsmStreamer.cpp
parent9e8baa5c17183143f5a9b94d409b3c0c9e3df8ec (diff)
downloadbcm5719-llvm-524138176df588fdd466e66986df08d4d32918bd.tar.gz
bcm5719-llvm-524138176df588fdd466e66986df08d4d32918bd.zip
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. llvm-svn: 95929
Diffstat (limited to 'llvm/lib/MC/MCAsmStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCAsmStreamer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index 2a8f168f931..6add1b4abaa 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud