1*9880d681SAndroid Build Coastguard Worker //===-- llvm/MC/MCCodeEmitter.h - Instruction Encoding ----------*- C++ -*-===// 2*9880d681SAndroid Build Coastguard Worker // 3*9880d681SAndroid Build Coastguard Worker // The LLVM Compiler Infrastructure 4*9880d681SAndroid Build Coastguard Worker // 5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source 6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details. 7*9880d681SAndroid Build Coastguard Worker // 8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===// 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_MC_MCCODEEMITTER_H 11*9880d681SAndroid Build Coastguard Worker #define LLVM_MC_MCCODEEMITTER_H 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Compiler.h" 14*9880d681SAndroid Build Coastguard Worker 15*9880d681SAndroid Build Coastguard Worker namespace llvm { 16*9880d681SAndroid Build Coastguard Worker class MCFixup; 17*9880d681SAndroid Build Coastguard Worker class MCInst; 18*9880d681SAndroid Build Coastguard Worker class MCSubtargetInfo; 19*9880d681SAndroid Build Coastguard Worker class raw_ostream; 20*9880d681SAndroid Build Coastguard Worker template<typename T> class SmallVectorImpl; 21*9880d681SAndroid Build Coastguard Worker 22*9880d681SAndroid Build Coastguard Worker /// MCCodeEmitter - Generic instruction encoding interface. 23*9880d681SAndroid Build Coastguard Worker class MCCodeEmitter { 24*9880d681SAndroid Build Coastguard Worker private: 25*9880d681SAndroid Build Coastguard Worker MCCodeEmitter(const MCCodeEmitter &) = delete; 26*9880d681SAndroid Build Coastguard Worker void operator=(const MCCodeEmitter &) = delete; 27*9880d681SAndroid Build Coastguard Worker 28*9880d681SAndroid Build Coastguard Worker protected: // Can only create subclasses. 29*9880d681SAndroid Build Coastguard Worker MCCodeEmitter(); 30*9880d681SAndroid Build Coastguard Worker 31*9880d681SAndroid Build Coastguard Worker public: 32*9880d681SAndroid Build Coastguard Worker virtual ~MCCodeEmitter(); 33*9880d681SAndroid Build Coastguard Worker 34*9880d681SAndroid Build Coastguard Worker /// Lifetime management reset()35*9880d681SAndroid Build Coastguard Worker virtual void reset() {} 36*9880d681SAndroid Build Coastguard Worker 37*9880d681SAndroid Build Coastguard Worker /// EncodeInstruction - Encode the given \p Inst to bytes on the output 38*9880d681SAndroid Build Coastguard Worker /// stream \p OS. 39*9880d681SAndroid Build Coastguard Worker virtual void encodeInstruction(const MCInst &Inst, raw_ostream &OS, 40*9880d681SAndroid Build Coastguard Worker SmallVectorImpl<MCFixup> &Fixups, 41*9880d681SAndroid Build Coastguard Worker const MCSubtargetInfo &STI) const = 0; 42*9880d681SAndroid Build Coastguard Worker }; 43*9880d681SAndroid Build Coastguard Worker 44*9880d681SAndroid Build Coastguard Worker } // End llvm namespace 45*9880d681SAndroid Build Coastguard Worker 46*9880d681SAndroid Build Coastguard Worker #endif 47