6cca95b826ada108c4abb2aaaf039fec9b46e7e0
[oota-llvm.git] / include / llvm / MC / MCCodeEmitter.h
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 namespace llvm {
14 class MCInst;
15 class raw_ostream;
16
17 /// MCCodeEmitter - Generic instruction encoding interface.
18 class MCCodeEmitter {
19   MCCodeEmitter(const MCCodeEmitter &);   // DO NOT IMPLEMENT
20   void operator=(const MCCodeEmitter &);  // DO NOT IMPLEMENT
21 protected: // Can only create subclasses.
22   MCCodeEmitter();
23  
24 public:
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