MSP430InstPrinter.h revision b950585cc5a0d665e9accfe5ce490cd269756f2e
1d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky//===-- MSP430InstPrinter.h - Convert MSP430 MCInst to assembly syntax ----===//
2d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky//
3d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky//                     The LLVM Compiler Infrastructure
4d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky//
5d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky// This file is distributed under the University of Illinois Open Source
6d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky// License. See LICENSE.TXT for details.
7d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky//
8d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky//===----------------------------------------------------------------------===//
9d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky//
10d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky// This class prints a MSP430 MCInst to a .s file.
11d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky//
12d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky//===----------------------------------------------------------------------===//
13d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky
14d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky#ifndef MSP430INSTPRINTER_H
15d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky#define MSP430INSTPRINTER_H
16d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky
17d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky#include "llvm/MC/MCInstPrinter.h"
18d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky
19d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewyckynamespace llvm {
20d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky  class MCOperand;
21d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky
22d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky  class MSP430InstPrinter : public MCInstPrinter {
23d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky  public:
24b262799d49891b036daa00eddf51947487346c98Evan Cheng    MSP430InstPrinter(const MCAsmInfo &MAI)
25b950585cc5a0d665e9accfe5ce490cd269756f2eJames Molloy        : MCInstPrinter(MAI) {}
26d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky
27d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky    virtual void printInst(const MCInst *MI, raw_ostream &O);
28d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky
29d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky    // Autogenerated by tblgen.
30d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky    void printInstruction(const MCInst *MI, raw_ostream &O);
31d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky    static const char *getRegisterName(unsigned RegNo);
32d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky
33d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky    void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O,
34d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky                      const char *Modifier = 0);
35d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky    void printPCRelImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
36d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky    void printSrcMemOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O,
37d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky                            const char *Modifier = 0);
38d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky    void printCCOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
39d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky
40d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky  };
41d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky}
42d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky
43d0669493b8d42544a94bddcd94d635e0701f6415Nick Lewycky#endif
44