LLVM: llvm::MCAsmBackend Class Reference (original) (raw)

Generic interface to target specific assembler backends. More...

#include "[llvm/MC/MCAsmBackend.h](MCAsmBackend%5F8h%5Fsource.html)"

Public Member Functions
MCAsmBackend (const MCAsmBackend &)=delete
MCAsmBackend & operator= (const MCAsmBackend &)=delete
virtual ~MCAsmBackend ()
void setAssembler (MCAssembler *A)
MCContext & getContext () const
bool allowAutoPadding () const
Return true if this target might automatically pad instructions and thus need to emit padding enable/disable directives around sensative code.
bool allowEnhancedRelaxation () const
Return true if this target allows an unrelaxable instruction to be emitted into RelaxableFragment and then we can increase its size in a tricky way for optimization.
virtual void reset ()
lifetime management
std::unique_ptr< MCObjectWriter > createObjectWriter (raw_pwrite_stream &OS) const
Create a new MCObjectWriter instance for use by the assembler backend to emit the final object file.
std::unique_ptr< MCObjectWriter > createDwoObjectWriter (raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS) const
Create an MCObjectWriter that writes two object files: a .o file which is linked into the final program and a .dwo file which is used by debuggers.
virtual std::unique_ptr< MCObjectTargetWriter > createObjectTargetWriter () const =0
virtual unsigned getMinimumNopSize () const
Returns the minimum size of a nop in bytes on this target.
virtual unsigned getMaximumNopSize (const MCSubtargetInfo &STI) const
Returns the maximum size of a nop in bytes on this target.
virtual bool writeNopData (raw_ostream &OS, uint64_t Count, const MCSubtargetInfo *STI) const =0
Write an (optimal) nop sequence of Count bytes to the given output.
virtual bool finishLayout () const
virtual uint64_t generateCompactUnwindEncoding (const MCDwarfFrameInfo *FI, const MCContext *Ctxt) const
Generate the compact unwind encoding for the CFI instructions.
bool isDarwinCanonicalPersonality (const MCSymbol *Sym) const
Target Fixup Interfaces
virtual std::optional< MCFixupKind > getFixupKind (StringRef Name) const
Map a relocation name used in .reloc to a fixup kind.
virtual MCFixupKindInfo getFixupKindInfo (MCFixupKind Kind) const
Get information on a fixup kind.
virtual std::optional< bool > evaluateFixup (const MCFragment &, MCFixup &, MCValue &, uint64_t &)
void maybeAddReloc (const MCFragment &, const MCFixup &, const MCValue &, uint64_t &Value, bool IsResolved)
virtual void applyFixup (const MCFragment &, const MCFixup &, const MCValue &Target, uint8_t *Data, uint64_t Value, bool IsResolved)=0
Target Relaxation Interfaces
virtual bool mayNeedRelaxation (unsigned Opcode, ArrayRef< MCOperand > Operands, const MCSubtargetInfo &STI) const
Check whether the given instruction (encoded as Opcode+Operands) may need relaxation.
virtual bool fixupNeedsRelaxationAdvanced (const MCFragment &, const MCFixup &, const MCValue &, uint64_t, bool Resolved) 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
Simple predicate for targets where !Resolved implies requiring relaxation.
virtual void relaxInstruction (MCInst &Inst, const MCSubtargetInfo &STI) const
Relax the instruction in the given fragment to the next wider instruction.
virtual bool relaxAlign (MCFragment &F, unsigned &Size)
virtual bool relaxDwarfLineAddr (MCFragment &) const
virtual bool relaxDwarfCFA (MCFragment &) const
virtual bool relaxSFrameCFA (MCFragment &) const
virtual std::pair< bool, bool > relaxLEB128 (MCFragment &, int64_t &Value) const

Generic interface to target specific assembler backends.

Definition at line 55 of file MCAsmBackend.h.

MCAsmBackend() [2/2]

~MCAsmBackend()

MCAsmBackend::~MCAsmBackend ( ) virtualdefault

allowAutoPadding()

bool llvm::MCAsmBackend::allowAutoPadding ( ) const inline

Return true if this target might automatically pad instructions and thus need to emit padding enable/disable directives around sensative code.

Definition at line 77 of file MCAsmBackend.h.

References AllowAutoPadding.

allowEnhancedRelaxation()

bool llvm::MCAsmBackend::allowEnhancedRelaxation ( ) const inline

applyFixup()

createDwoObjectWriter()

createObjectTargetWriter()

virtual std::unique_ptr< MCObjectTargetWriter > llvm::MCAsmBackend::createObjectTargetWriter ( ) const pure virtual

createObjectWriter()

Create a new MCObjectWriter instance for use by the assembler backend to emit the final object file.

Definition at line 32 of file MCAsmBackend.cpp.

References llvm::cast(), llvm::Triple::COFF, llvm::createGOFFObjectWriter(), createObjectTargetWriter(), llvm::createSPIRVObjectWriter(), llvm::createWasmObjectWriter(), llvm::createWinCOFFObjectWriter(), llvm::createXCOFFObjectWriter(), llvm::Triple::DXContainer, llvm::Triple::ELF, Endian, llvm::Triple::GOFF, llvm::little, llvm_unreachable, llvm::Triple::MachO, llvm::Triple::SPIRV, llvm::Triple::Wasm, and llvm::Triple::XCOFF.

Referenced by llvm::CodeGenTargetMachineImpl::addPassesToEmitMC(), and llvm::CodeGenTargetMachineImpl::createMCStreamer().

evaluateFixup()

finishLayout()

virtual bool llvm::MCAsmBackend::finishLayout ( ) const inlinevirtual

fixupNeedsRelaxation()

fixupNeedsRelaxationAdvanced()

generateCompactUnwindEncoding()

getContext()

MCContext & MCAsmBackend::getContext ( ) const

Definition at line 29 of file MCAsmBackend.cpp.

References Asm.

Referenced by llvm::ARMAsmBackend::adjustFixupValue(), llvm::ARMAsmBackend::applyFixup(), llvm::AVRAsmBackend::applyFixup(), llvm::CSKYAsmBackend::applyFixup(), llvm::LoongArchAsmBackend::applyFixup(), llvm::MipsAsmBackend::applyFixup(), llvm::RISCVAsmBackend::applyFixup(), llvm::RISCVAsmBackend::evaluateFixup(), isDarwinCanonicalPersonality(), llvm::LoongArchAsmBackend::relaxAlign(), llvm::RISCVAsmBackend::relaxAlign(), llvm::LoongArchAsmBackend::relaxDwarfCFA(), llvm::RISCVAsmBackend::relaxDwarfCFA(), llvm::LoongArchAsmBackend::relaxDwarfLineAddr(), and llvm::RISCVAsmBackend::relaxDwarfLineAddr().

getFixupKind()

getFixupKindInfo()

Get information on a fixup kind.

Reimplemented in llvm::ARMAsmBackend, llvm::AVRAsmBackend, llvm::CSKYAsmBackend, llvm::LoongArchAsmBackend, llvm::MipsAsmBackend, and llvm::RISCVAsmBackend.

Definition at line 89 of file MCAsmBackend.cpp.

References assert(), and llvm::FK_NONE.

Referenced by createObjectTargetWriter(), llvm::ARMAsmBackend::getFixupKindInfo(), llvm::AVRAsmBackend::getFixupKindInfo(), llvm::CSKYAsmBackend::getFixupKindInfo(), llvm::LoongArchAsmBackend::getFixupKindInfo(), llvm::MipsAsmBackend::getFixupKindInfo(), and llvm::RISCVAsmBackend::getFixupKindInfo().

getMaximumNopSize()

Returns the maximum size of a nop in bytes on this target.

Definition at line 190 of file MCAsmBackend.h.

getMinimumNopSize()

virtual unsigned llvm::MCAsmBackend::getMinimumNopSize ( ) const inlinevirtual

Returns the minimum size of a nop in bytes on this target.

The assembler will use this to emit excess padding in situations where the padding required for simple alignment would be less than the minimum nop size.

Definition at line 186 of file MCAsmBackend.h.

getSubtargetInfo()

isDarwinCanonicalPersonality()

maybeAddReloc()

mayNeedRelaxation()

operator=()

relaxAlign()

relaxDwarfCFA()

virtual bool llvm::MCAsmBackend::relaxDwarfCFA ( MCFragment & ) const inlinevirtual

relaxDwarfLineAddr()

virtual bool llvm::MCAsmBackend::relaxDwarfLineAddr ( MCFragment & ) const inlinevirtual

relaxInstruction()

relaxLEB128()

virtual std::pair< bool, bool > llvm::MCAsmBackend::relaxLEB128 ( MCFragment & , int64_t & Value ) const inlinevirtual

relaxSFrameCFA()

virtual bool llvm::MCAsmBackend::relaxSFrameCFA ( MCFragment & ) const inlinevirtual

reset()

virtual void llvm::MCAsmBackend::reset ( ) inlinevirtual

setAssembler()

void llvm::MCAsmBackend::setAssembler ( MCAssembler * A) inline

writeNopData()

AllowAutoPadding

bool llvm::MCAsmBackend::AllowAutoPadding = false protected

AllowEnhancedRelaxation

bool llvm::MCAsmBackend::AllowEnhancedRelaxation = false protected

Asm

Definition at line 59 of file MCAsmBackend.h.

Referenced by llvm::LoongArchAsmBackend::addReloc(), llvm::RISCVAsmBackend::addReloc(), llvm::ARMAsmBackend::adjustFixupValue(), llvm::ARMAsmBackend::applyFixup(), llvm::AVRAsmBackend::applyFixup(), llvm::ARMAsmBackend::evaluateFixup(), llvm::CSKYAsmBackend::evaluateFixup(), llvm::RISCVAsmBackend::evaluateFixup(), llvm::ARMAsmBackend::fixupNeedsRelaxationAdvanced(), getContext(), maybeAddReloc(), llvm::RISCVAsmBackend::maybeAddVendorReloc(), llvm::LoongArchAsmBackend::relaxAlign(), llvm::LoongArchAsmBackend::relaxDwarfCFA(), llvm::RISCVAsmBackend::relaxDwarfCFA(), llvm::LoongArchAsmBackend::relaxDwarfLineAddr(), llvm::RISCVAsmBackend::relaxDwarfLineAddr(), llvm::LoongArchAsmBackend::relaxLEB128(), llvm::RISCVAsmBackend::relaxLEB128(), setAssembler(), and llvm::ARMAsmBackend::shouldForceRelocation().

Endian

Definition at line 69 of file MCAsmBackend.h.

Referenced by llvm::ARMAsmBackend::adjustFixupValue(), llvm::ARMAsmBackend::applyFixup(), llvm::CSKYAsmBackend::applyFixup(), llvm::MipsAsmBackend::applyFixup(), llvm::RISCVAsmBackend::applyFixup(), llvm::ARMAsmBackend::ARMAsmBackend(), llvm::ARMAsmBackendELF::ARMAsmBackendELF(), createDwoObjectWriter(), createObjectWriter(), llvm::ARMAsmBackend::getFixupKindInfo(), llvm::MipsAsmBackend::getFixupKindInfo(), MCAsmBackend(), llvm::RISCVAsmBackend::relaxDwarfCFA(), llvm::RISCVAsmBackend::relaxDwarfLineAddr(), and llvm::ARMAsmBackend::writeNopData().


The documentation for this class was generated from the following files: