blob: 3060ad6003d4176e4e9cb1a8ca19588d11f0e7cb [file] [log] [blame]
Chris Lattner65b0b292009-09-14 01:43:38 +00001//===-- 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"
Owen Anderson317eaf12011-09-21 00:25:23 +000011#include "llvm/MC/MCAsmInfo.h"
Chris Lattner7e851802010-02-11 22:39:10 +000012#include "llvm/ADT/StringRef.h"
Craig Topper85814382012-02-07 05:05:23 +000013#include "llvm/Support/ErrorHandling.h"
Owen Andersonede042d2011-09-15 18:36:29 +000014#include "llvm/Support/raw_ostream.h"
Chris Lattner65b0b292009-09-14 01:43:38 +000015using namespace llvm;
16
17MCInstPrinter::~MCInstPrinter() {
Edward O'Callaghanaa5c1b72009-10-05 18:43:19 +000018}
Chris Lattner7e851802010-02-11 22:39:10 +000019
20/// getOpcodeName - Return the name of the specified opcode enum (e.g.
21/// "MOV32ri") or empty if we can't resolve it.
22StringRef MCInstPrinter::getOpcodeName(unsigned Opcode) const {
23 return "";
24}
Anton Korobeynikov57caad72011-03-05 18:43:32 +000025
Rafael Espindolacde4ce42011-06-02 02:34:55 +000026void MCInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
Craig Topper85814382012-02-07 05:05:23 +000027 llvm_unreachable("Target should implement this");
Anton Korobeynikov57caad72011-03-05 18:43:32 +000028}
Owen Andersonede042d2011-09-15 18:36:29 +000029
Owen Anderson98c5dda2011-09-15 23:38:46 +000030void MCInstPrinter::printAnnotation(raw_ostream &OS, StringRef Annot) {
Owen Anderson317eaf12011-09-21 00:25:23 +000031 if (!Annot.empty()) {
32 if (CommentStream)
Kevin Enderby9e5887b2011-10-04 22:44:48 +000033 (*CommentStream) << Annot;
Owen Anderson317eaf12011-09-21 00:25:23 +000034 else
Kevin Enderby9e5887b2011-10-04 22:44:48 +000035 OS << " " << MAI.getCommentString() << " " << Annot;
Owen Anderson317eaf12011-09-21 00:25:23 +000036 }
Owen Andersonede042d2011-09-15 18:36:29 +000037}