MCCodeEmitter.h revision c5252da873d547a19069eaf9030fec203f128f66
13c827367444ee418f129b2c238299f49d3264554Jarkko Poyry//===-- llvm/MC/MCCodeEmitter.h - Instruction Encoding ----------*- C++ -*-===//
23c827367444ee418f129b2c238299f49d3264554Jarkko Poyry//
33c827367444ee418f129b2c238299f49d3264554Jarkko Poyry//                     The LLVM Compiler Infrastructure
43c827367444ee418f129b2c238299f49d3264554Jarkko Poyry//
53c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// This file is distributed under the University of Illinois Open Source
63c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// License. See LICENSE.TXT for details.
73c827367444ee418f129b2c238299f49d3264554Jarkko Poyry//
83c827367444ee418f129b2c238299f49d3264554Jarkko Poyry//===----------------------------------------------------------------------===//
93c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#ifndef LLVM_MC_MCCODEEMITTER_H
113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#define LLVM_MC_MCCODEEMITTER_H
123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "llvm/Support/Compiler.h"
143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
153c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace llvm {
163c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass MCFixup;
173c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass MCInst;
183c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass raw_ostream;
193c827367444ee418f129b2c238299f49d3264554Jarkko Poyrytemplate<typename T> class SmallVectorImpl;
203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
213c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/// MCCodeEmitter - Generic instruction encoding interface.
223c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass MCCodeEmitter {
233c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprivate:
243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry  MCCodeEmitter(const MCCodeEmitter &) LLVM_DELETED_FUNCTION;
253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry  void operator=(const MCCodeEmitter &) LLVM_DELETED_FUNCTION;
263c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprotected: // Can only create subclasses.
273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry  MCCodeEmitter();
283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
293c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry  virtual ~MCCodeEmitter();
313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry  /// EncodeInstruction - Encode the given \p Inst to bytes on the output
333c827367444ee418f129b2c238299f49d3264554Jarkko Poyry  /// stream \p OS.
343c827367444ee418f129b2c238299f49d3264554Jarkko Poyry  virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS,
353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry                                 SmallVectorImpl<MCFixup> &Fixups) const = 0;
363c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
383c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // End llvm namespace
393c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
403c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#endif
413c827367444ee418f129b2c238299f49d3264554Jarkko Poyry