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/MC/MCFixup.h"
14 #include "llvm/MC/MCFixupKindInfo.h"
22 template<typename T> class SmallVectorImpl;
24 /// MCCodeEmitter - Generic instruction encoding interface.
27 MCCodeEmitter(const MCCodeEmitter &); // DO NOT IMPLEMENT
28 void operator=(const MCCodeEmitter &); // DO NOT IMPLEMENT
29 protected: // Can only create subclasses.
33 virtual ~MCCodeEmitter();
35 /// @name Target Independent Fixup Information
38 /// getNumFixupKinds - Get the number of target specific fixup kinds.
39 virtual unsigned getNumFixupKinds() const = 0;
41 /// getFixupKindInfo - Get information on a fixup kind.
42 virtual const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const;
46 /// EncodeInstruction - Encode the given \arg Inst to bytes on the output
48 virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS,
49 SmallVectorImpl<MCFixup> &Fixups) const = 0;
52 } // End llvm namespace