MCCodeEmitter.h revision 1f7210e808373fa92be3a2d4fa653a6f79d5088b
1//===-- llvm/MC/MCCodeEmitter.h - Instruction Encoding ----------*- C++ -*-===//
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#ifndef LLVM_MC_MCCODEEMITTER_H
11#define LLVM_MC_MCCODEEMITTER_H
12
13#include "llvm/Support/Compiler.h"
14
15namespace llvm {
16class MCFixup;
17class MCInst;
18class raw_ostream;
19template<typename T> class SmallVectorImpl;
20
21/// MCCodeEmitter - Generic instruction encoding interface.
22class MCCodeEmitter {
23private:
24  MCCodeEmitter(const MCCodeEmitter &) LLVM_DELETED_FUNCTION;
25  void operator=(const MCCodeEmitter &) LLVM_DELETED_FUNCTION;
26protected: // Can only create subclasses.
27  MCCodeEmitter();
28
29public:
30  virtual ~MCCodeEmitter();
31
32  /// EncodeInstruction - Encode the given \arg Inst to bytes on the output
33  /// stream \arg OS.
34  virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS,
35                                 SmallVectorImpl<MCFixup> &Fixups) const = 0;
36};
37
38} // End llvm namespace
39
40#endif
41