X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FMC%2FMCCodeEmitter.h;h=d3b56177d50a7666af704f4e30362133405bd868;hb=d2c5947a4cb8e142294fabebb2a7154d41386c5e;hp=2588661b62a802317c251a3dc78569382f7f69b5;hpb=05018c2f2872a05b1a2fff1a9934621ba1f38084;p=oota-llvm.git diff --git a/include/llvm/MC/MCCodeEmitter.h b/include/llvm/MC/MCCodeEmitter.h index 2588661b62a..d3b56177d50 100644 --- a/include/llvm/MC/MCCodeEmitter.h +++ b/include/llvm/MC/MCCodeEmitter.h @@ -10,72 +10,34 @@ #ifndef LLVM_MC_MCCODEEMITTER_H #define LLVM_MC_MCCODEEMITTER_H -#include "llvm/MC/MCFixup.h" - -#include +#include "llvm/Support/Compiler.h" namespace llvm { -class MCExpr; +class MCFixup; class MCInst; +class MCSubtargetInfo; class raw_ostream; template class SmallVectorImpl; -/// MCFixupKindInfo - Target independent information on a fixup kind. -struct MCFixupKindInfo { - enum FixupKindFlags { - /// Is this fixup kind PCrelative? This is used by the assembler backend to - /// evaluate fixup values in a target independent manner when possible. - FKF_IsPCRel = (1 << 0), - - // Should this fixup kind force a 4-byte aligned effective PC value? - FKF_IsAligned = (1 << 1) - }; - - /// A target specific name for the fixup kind. The names will be unique for - /// distinct kinds on any given target. - const char *Name; - - /// The bit offset to write the relocation into. - // - // FIXME: These two fields are under-specified and not general enough, but it - // covers many things. It's enough to let the AsmStreamer pretty-print - // the encoding. - unsigned TargetOffset; - - /// The number of bits written by this fixup. The bits are assumed to be - /// contiguous. - unsigned TargetSize; - - /// Flags describing additional information on this fixup kind. - unsigned Flags; -}; - /// MCCodeEmitter - Generic instruction encoding interface. class MCCodeEmitter { private: - MCCodeEmitter(const MCCodeEmitter &); // DO NOT IMPLEMENT - void operator=(const MCCodeEmitter &); // DO NOT IMPLEMENT + MCCodeEmitter(const MCCodeEmitter &) LLVM_DELETED_FUNCTION; + void operator=(const MCCodeEmitter &) LLVM_DELETED_FUNCTION; protected: // Can only create subclasses. MCCodeEmitter(); public: virtual ~MCCodeEmitter(); - /// @name Target Independent Fixup Information - /// @{ - - /// getNumFixupKinds - Get the number of target specific fixup kinds. - virtual unsigned getNumFixupKinds() const = 0; - - /// getFixupKindInfo - Get information on a fixup kind. - virtual const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const; - - /// @} + /// Lifetime management + virtual void reset() { } - /// EncodeInstruction - Encode the given \arg Inst to bytes on the output - /// stream \arg OS. + /// EncodeInstruction - Encode the given \p Inst to bytes on the output + /// stream \p OS. virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS, - SmallVectorImpl &Fixups) const = 0; + SmallVectorImpl &Fixups, + const MCSubtargetInfo &STI) const = 0; }; } // End llvm namespace