diff options
| author | Owen Anderson <resistor@mac.com> | 2011-09-21 00:25:23 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2011-09-21 00:25:23 +0000 |
| commit | 69fa8ffeef2a3c68cc7d6edc3cfd862b74501af5 (patch) | |
| tree | d1f32ee4efb88c65e686cca1349e5a9b19e62eab /llvm/lib/MC/MCInstPrinter.cpp | |
| parent | 155137bd102c2f769c05f17715265f82b611a65c (diff) | |
| download | bcm5719-llvm-69fa8ffeef2a3c68cc7d6edc3cfd862b74501af5.tar.gz bcm5719-llvm-69fa8ffeef2a3c68cc7d6edc3cfd862b74501af5.zip | |
In the disassembler C API, be careful not to confuse the comment streamer that the disassembler outputs annotations on with the streamer that the InstPrinter will print them on.
llvm-svn: 140217
Diffstat (limited to 'llvm/lib/MC/MCInstPrinter.cpp')
| -rw-r--r-- | llvm/lib/MC/MCInstPrinter.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCInstPrinter.cpp b/llvm/lib/MC/MCInstPrinter.cpp index e15e1076169..5dbd4b015d7 100644 --- a/llvm/lib/MC/MCInstPrinter.cpp +++ b/llvm/lib/MC/MCInstPrinter.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "llvm/MC/MCInstPrinter.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -26,5 +27,10 @@ void MCInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const { } void MCInstPrinter::printAnnotation(raw_ostream &OS, StringRef Annot) { - if (!Annot.empty()) OS << Annot << "\n"; + if (!Annot.empty()) { + if (CommentStream) + (*CommentStream) << Annot << "\n"; + else + OS << " " << MAI.getCommentString() << " " << Annot << "\n"; + } } |

