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
17 class MCSubtargetInfo;
19 template<typename T> class SmallVectorImpl;
21 /// MCCodeEmitter - Generic instruction encoding interface.
23 protected: // Can only create subclasses.
27 MCCodeEmitter(const MCCodeEmitter &) = delete;
28 MCCodeEmitter &operator=(const MCCodeEmitter &) = delete;
29 virtual ~MCCodeEmitter();
31 /// Lifetime management
32 virtual void reset() {}
34 /// EncodeInstruction - Encode the given \p Inst to bytes on the output
36 virtual void encodeInstruction(const MCInst &Inst, raw_ostream &OS,
37 SmallVectorImpl<MCFixup> &Fixups,
38 const MCSubtargetInfo &STI) const = 0;
41 } // end namespace llvm
43 #endif // LLVM_MC_MCCODEEMITTER_H