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 MCFixup; 15 class MCInst; 16 class raw_ostream; 17 template<typename T> class SmallVectorImpl; 18 19 /// MCCodeEmitter - Generic instruction encoding interface. 20 class MCCodeEmitter { 21 private: 22 MCCodeEmitter(const MCCodeEmitter &); // DO NOT IMPLEMENT 23 void operator=(const MCCodeEmitter &); // DO NOT IMPLEMENT 24 protected: // Can only create subclasses. 25 MCCodeEmitter(); 26 27 public: 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