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