1 //===-- MCInstPrinter.cpp - Convert an MCInst to target assembly syntax ---===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/MC/MCInstPrinter.h"
11 #include "llvm/MC/MCInstrInfo.h"
12 #include "llvm/MC/MCAsmInfo.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/ErrorHandling.h"
15 #include "llvm/Support/raw_ostream.h"
18 MCInstPrinter::~MCInstPrinter() {
21 /// getOpcodeName - Return the name of the specified opcode enum (e.g.
22 /// "MOV32ri") or empty if we can't resolve it.
23 StringRef MCInstPrinter::getOpcodeName(unsigned Opcode) const {
24 return MII.getName(Opcode);
27 void MCInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
28 llvm_unreachable("Target should implement this");
31 void MCInstPrinter::printAnnotation(raw_ostream &OS, StringRef Annot) {
34 (*CommentStream) << Annot;
36 OS << " " << MAI.getCommentString() << " " << Annot;