10 #ifndef LLVM_MC_MCASMBACKEND_H
11 #define LLVM_MC_MCASMBACKEND_H
17 #include "llvm/Support/DataTypes.h"
23 class MCCFIInstruction;
24 class MCELFObjectTargetWriter;
25 struct MCFixupKindInfo;
28 class MCRelaxableFragment;
31 class MCSubtargetInfo;
33 class raw_pwrite_stream;
78 uint64_t
Value,
bool IsPCRel)
const = 0;
virtual MCObjectWriter * createObjectWriter(raw_pwrite_stream &OS) const =0
Create a new MCObjectWriter instance for use by the assembler backend to emit the final object file...
virtual void finishLayout(MCAssembler const &Asm, MCAsmLayout &Layout) const
Give backend an opportunity to finish layout after relaxation.
This represents an "assembler immediate".
virtual void relaxInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, MCInst &Res) const =0
Relax the instruction in the given fragment to the next wider instruction.
virtual bool fixupNeedsRelaxationAdvanced(const MCFixup &Fixup, bool Resolved, uint64_t Value, const MCRelaxableFragment *DF, const MCAsmLayout &Layout) const
Target specific predicate for whether a given fixup requires the associated instruction to be relaxed...
virtual bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value, const MCRelaxableFragment *DF, const MCAsmLayout &Layout) const =0
Simple predicate for targets where !Resolved implies requiring relaxation.
Defines the object file and target independent interfaces used by the assembler backend to write nati...
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
virtual unsigned getMinimumNopSize() const
Returns the minimum size of a nop in bytes on this target.
Encapsulates the layout of an assembly file at a particular point in time.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
virtual void applyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, uint64_t Value, bool IsPCRel) const =0
Apply the Value for given Fixup into the provided data fragment, at the offset specified by the fixup...
Instances of this class represent a single low-level machine instruction.
virtual bool writeNopData(uint64_t Count, MCObjectWriter *OW) const =0
Write an (optimal) nop sequence of Count bytes to the given output.
Flag
These should be considered private to the implementation of the MCInstrDesc class.
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
MCFixupKind
Extensible enumeration to represent the type of a fixup.
virtual void processFixupValue(const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFixup &Fixup, const MCFragment *DF, const MCValue &Target, uint64_t &Value, bool &IsResolved)
Target hook to adjust the literal value of a fixup if necessary.
virtual bool mayNeedRelaxation(const MCInst &Inst) const =0
Check whether the given instruction may need relaxation.
virtual Optional< MCFixupKind > getFixupKind(StringRef Name) const
Map a relocation name used in .reloc to a fixup kind.
virtual unsigned getNumFixupKinds() const =0
Get the number of target specific fixup kinds.
Target - Wrapper for Target specific information.
virtual void handleAssemblerFlag(MCAssemblerFlag Flag)
Handle any target-specific assembler flags. By default, do nothing.
MCSubtargetInfo - Generic base class for all target subtargets.
virtual uint32_t generateCompactUnwindEncoding(ArrayRef< MCCFIInstruction >) const
Generate the compact unwind encoding for the CFI instructions.
Target independent information on a fixup kind.
An abstract base class for streams implementations that also support a pwrite operation.
LLVM Value Representation.
Generic interface to target specific assembler backends.
StringRef - Represent a constant reference to a string, i.e.
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
virtual void reset()
lifetime management