1 //===-- llvm/MC/MCCodeEmitter.h - Instruction Encoding ----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_MC_MCCODEEMITTER_H
11 #define LLVM_MC_MCCODEEMITTER_H
13 #include "llvm/Support/Compiler.h"
18 class MCSubtargetInfo;
20 template<typename T> class SmallVectorImpl;
22 /// MCCodeEmitter - Generic instruction encoding interface.
25 MCCodeEmitter(const MCCodeEmitter &) LLVM_DELETED_FUNCTION;
26 void operator=(const MCCodeEmitter &) LLVM_DELETED_FUNCTION;
27 protected: // Can only create subclasses.
31 virtual ~MCCodeEmitter();
33 /// Lifetime management
34 virtual void reset() { }
36 /// EncodeInstruction - Encode the given \p Inst to bytes on the output
38 virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS,
39 SmallVectorImpl<MCFixup> &Fixups,
40 const MCSubtargetInfo &STI) const = 0;
43 } // End llvm namespace