LLVM API Documentation

MCCodeEmitter.h
Go to the documentation of this file.
00001 //===-- llvm/MC/MCCodeEmitter.h - Instruction Encoding ----------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #ifndef LLVM_MC_MCCODEEMITTER_H
00011 #define LLVM_MC_MCCODEEMITTER_H
00012 
00013 #include "llvm/Support/Compiler.h"
00014 
00015 namespace llvm {
00016 class MCFixup;
00017 class MCInst;
00018 class MCSubtargetInfo;
00019 class raw_ostream;
00020 template<typename T> class SmallVectorImpl;
00021 
00022 /// MCCodeEmitter - Generic instruction encoding interface.
00023 class MCCodeEmitter {
00024 private:
00025   MCCodeEmitter(const MCCodeEmitter &) LLVM_DELETED_FUNCTION;
00026   void operator=(const MCCodeEmitter &) LLVM_DELETED_FUNCTION;
00027 protected: // Can only create subclasses.
00028   MCCodeEmitter();
00029 
00030 public:
00031   virtual ~MCCodeEmitter();
00032 
00033   /// Lifetime management
00034   virtual void reset() { }
00035 
00036   /// EncodeInstruction - Encode the given \p Inst to bytes on the output
00037   /// stream \p OS.
00038   virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS,
00039                                  SmallVectorImpl<MCFixup> &Fixups,
00040                                  const MCSubtargetInfo &STI) const = 0;
00041 };
00042 
00043 } // End llvm namespace
00044 
00045 #endif