MCCodeEmitter.h revision f1d0f7781e766df878bec4e7977fa3204374f394
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
13namespace llvm {
14class MCFixup;
15class MCInst;
16class raw_ostream;
17template<typename T> class SmallVectorImpl;
18
19/// MCCodeEmitter - Generic instruction encoding interface.
20class MCCodeEmitter {
21private:
22  MCCodeEmitter(const MCCodeEmitter &);   // DO NOT IMPLEMENT
23  void operator=(const MCCodeEmitter &);  // DO NOT IMPLEMENT
24protected: // Can only create subclasses.
25  MCCodeEmitter();
26
27public:
28  virtual ~MCCodeEmitter();
29
30  /// EncodeInstruction - Encode the given \arg Inst to bytes on the output
31  /// stream \arg OS.
32  virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS,
33                                 SmallVectorImpl<MCFixup> &Fixups) const = 0;
34};
35
36} // End llvm namespace
37
38#endif
39