10 #ifndef LLVM_MC_MCASMBACKEND_H
11 #define LLVM_MC_MCASMBACKEND_H
17 #include "llvm/Support/DataTypes.h"
23 class MCELFObjectTargetWriter;
24 struct MCFixupKindInfo;
27 class MCRelaxableFragment;
86 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...
This represents an "assembler immediate".
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.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned HasDataInCodeSupport
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...
virtual void relaxInstruction(const MCInst &Inst, MCInst &Res) const =0
Relax the instruction in the given fragment to the next wider instruction.
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 unsigned getNumFixupKinds() const =0
Get the number of target specific fixup kinds.
PowerPC TLS Dynamic Call Fixup
Target - Wrapper for Target specific information.
bool hasDataInCodeSupport() const
Check whether this target implements data-in-code markers.
virtual void handleAssemblerFlag(MCAssemblerFlag Flag)
Handle any target-specific assembler flags. By default, do nothing.
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.
const ARM::ArchExtKind Kind
LLVM Value Representation.
Generic interface to target specific assembler backends.
virtual MCELFObjectTargetWriter * createELFObjectTargetWriter() const
Create a new ELFObjectTargetWriter to enable non-standard ELFObjectWriters.
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
virtual void reset()
lifetime management