MCInstPrinter.cpp revision 317eaf19937813d630166bfec7b933a98ea89aa5
1//===-- MCInstPrinter.cpp - Convert an MCInst to target assembly syntax ---===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "llvm/MC/MCInstPrinter.h"
11#include "llvm/MC/MCAsmInfo.h"
12#include "llvm/ADT/StringRef.h"
13#include "llvm/Support/raw_ostream.h"
14using namespace llvm;
15
16MCInstPrinter::~MCInstPrinter() {
17}
18
19/// getOpcodeName - Return the name of the specified opcode enum (e.g.
20/// "MOV32ri") or empty if we can't resolve it.
21StringRef MCInstPrinter::getOpcodeName(unsigned Opcode) const {
22  return "";
23}
24
25void MCInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
26  assert(0 && "Target should implement this");
27}
28
29void MCInstPrinter::printAnnotation(raw_ostream &OS, StringRef Annot) {
30  if (!Annot.empty()) {
31    if (CommentStream)
32      (*CommentStream) << Annot << "\n";
33    else
34      OS << " " << MAI.getCommentString() << " " << Annot << "\n";
35  }
36}
37