diff options
author | Owen Anderson <resistor@mac.com> | 2011-09-15 18:36:29 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2011-09-15 18:36:29 +0000 |
commit | ede042dc8d59ff48a48ef8e2271f2a7ee8324ba5 (patch) | |
tree | 1863d77a0f4430e093ef2933f38f299a5992c74b /lib/MC/MCInstPrinter.cpp | |
parent | 01afdb3a45f63af540b43b414c6094220a8f91e7 (diff) |
Add support for stored annotations to MCInst, and provide facilities for MC-based InstPrinters to print them out. Enhance the ARM and X86 InstPrinter's to do so in verbose mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139820 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCInstPrinter.cpp')
-rw-r--r-- | lib/MC/MCInstPrinter.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/MC/MCInstPrinter.cpp b/lib/MC/MCInstPrinter.cpp index 81a939ffaa..f0fa2cda4a 100644 --- a/lib/MC/MCInstPrinter.cpp +++ b/lib/MC/MCInstPrinter.cpp @@ -8,7 +8,10 @@ //===----------------------------------------------------------------------===// #include "llvm/MC/MCInstPrinter.h" +#include "llvm/MC/MCAsmInfo.h" +#include "llvm/MC/MCInst.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Support/raw_ostream.h" using namespace llvm; MCInstPrinter::~MCInstPrinter() { @@ -23,3 +26,9 @@ StringRef MCInstPrinter::getOpcodeName(unsigned Opcode) const { void MCInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const { assert(0 && "Target should implement this"); } + +void MCInstPrinter::printAnnotations(const MCInst *MI, raw_ostream &OS) { + for (unsigned i = 0, e = MI->getNumAnnotations(); i != e; ++i) { + OS << MI->getAnnotation(i) << "\n"; + } +} |