LLVM API Documentation
MCAsmBackend - Generic interface to target specific assembler backends. More...
#include <MCAsmBackend.h>
Public Member Functions | |
virtual | ~MCAsmBackend () |
virtual void | reset () |
lifetime management More... | |
virtual MCObjectWriter * | createObjectWriter (raw_ostream &OS) const =0 |
virtual MCELFObjectTargetWriter * | createELFObjectTargetWriter () const |
bool | hasReliableSymbolDifference () const |
bool | hasDataInCodeSupport () const |
virtual bool | doesSectionRequireSymbols (const MCSection &Section) const |
virtual bool | isSectionAtomizable (const MCSection &Section) const |
virtual void | applyFixup (const MCFixup &Fixup, char *Data, unsigned DataSize, uint64_t Value) const =0 |
virtual unsigned | getMinimumNopSize () const |
virtual bool | writeNopData (uint64_t Count, MCObjectWriter *OW) const =0 |
virtual void | handleAssemblerFlag (MCAssemblerFlag Flag) |
virtual uint32_t | generateCompactUnwindEncoding (ArrayRef< MCCFIInstruction >) const |
Generate the compact unwind encoding for the CFI instructions. More... | |
Target Fixup Interfaces | |
virtual unsigned | getNumFixupKinds () const =0 |
getNumFixupKinds - Get the number of target specific fixup kinds. More... | |
virtual const MCFixupKindInfo & | getFixupKindInfo (MCFixupKind Kind) const |
getFixupKindInfo - Get information on a fixup kind. More... | |
virtual void | processFixupValue (const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFixup &Fixup, const MCFragment *DF, MCValue &Target, uint64_t &Value, bool &IsResolved) |
Target Relaxation Interfaces | |
virtual bool | mayNeedRelaxation (const MCInst &Inst) const =0 |
virtual bool | fixupNeedsRelaxation (const MCFixup &Fixup, uint64_t Value, const MCRelaxableFragment *DF, const MCAsmLayout &Layout) const =0 |
virtual void | relaxInstruction (const MCInst &Inst, MCInst &Res) const =0 |
Protected Member Functions | |
MCAsmBackend () | |
Protected Attributes | |
unsigned | HasReliableSymbolDifference: 1 |
unsigned | HasDataInCodeSupport: 1 |
MCAsmBackend - Generic interface to target specific assembler backends.
Definition at line 34 of file MCAsmBackend.h.
|
protected |
Definition at line 15 of file MCAsmBackend.cpp.
|
virtual |
Definition at line 18 of file MCAsmBackend.cpp.
|
pure virtual |
applyFixup - Apply the Value
for given Fixup
into the provided data fragment, at the offset specified by the fixup and following the fixup kind as appropriate.
Referenced by llvm::MCAssembler::Finish().
|
inlinevirtual |
createELFObjectTargetWriter - Create a new ELFObjectTargetWriter to enable non-standard ELFObjectWriters.
Definition at line 56 of file MCAsmBackend.h.
References llvm_unreachable.
|
pure virtual |
createObjectWriter - Create a new MCObjectWriter instance for use by the assembler backend to emit the final object file.
|
inlinevirtual |
doesSectionRequireSymbols - Check whether the given section requires that all symbols (even temporaries) have symbol table entries.
Definition at line 81 of file MCAsmBackend.h.
Referenced by llvm::MCAssembler::isSymbolLinkerVisible().
|
pure virtual |
fixupNeedsRelaxation - Target specific predicate for whether a given fixup requires the associated instruction to be relaxed.
|
inlinevirtual |
Generate the compact unwind encoding for the CFI instructions.
Definition at line 166 of file MCAsmBackend.h.
Referenced by llvm::MCStreamer::generateCompactUnwindEncodings().
|
virtual |
getFixupKindInfo - Get information on a fixup kind.
Definition at line 21 of file MCAsmBackend.cpp.
References llvm::array_lengthof(), and llvm::MCFixupKindInfo::FKF_IsPCRel.
Referenced by llvm::MachObjectWriter::isFixupKindPCRel().
|
inlinevirtual |
getMinimumNopSize - 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 151 of file MCAsmBackend.h.
Referenced by llvm::MCAssembler::computeFragmentSize().
|
pure virtual |
getNumFixupKinds - Get the number of target specific fixup kinds.
|
inlinevirtual |
handleAssemblerFlag - Handle any target-specific assembler flags. By default, do nothing.
Definition at line 162 of file MCAsmBackend.h.
|
inline |
hasDataInCodeSupport - Check whether this target implements data-in-code markers. If not, data region directives will be ignored.
Definition at line 77 of file MCAsmBackend.h.
References HasDataInCodeSupport.
|
inline |
hasReliableSymbolDifference - Check whether this target implements accurate relocations for differences between symbols. If not, differences between symbols will always be relocatable expressions and any references to temporary symbols will be assumed to be in the same atom, unless they reside in a different section.
This should always be true (since it results in fewer relocations with no loss of functionality), but is currently supported as a way to maintain exact object compatibility with Darwin 'as' (on non-x86_64). It should eventually should be eliminated.
Definition at line 71 of file MCAsmBackend.h.
References HasReliableSymbolDifference.
Referenced by llvm::MachObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl().
|
inlinevirtual |
isSectionAtomizable - Check whether the given section can be split into atoms.
Definition at line 89 of file MCAsmBackend.h.
Referenced by llvm::MCAssembler::getAtom().
mayNeedRelaxation - Check whether the given instruction may need relaxation.
Inst | - The instruction to test. |
Referenced by llvm::MCObjectStreamer::EmitInstruction().
|
inlinevirtual |
processFixupValue - Target hook to adjust the literal value of a fixup if necessary. IsResolved signals whether the caller believes a relocation is needed; the target can modify the value. The default does nothing.
Definition at line 105 of file MCAsmBackend.h.
|
pure virtual |
RelaxInstruction - Relax the instruction in the given fragment to the next wider instruction.
Inst | The instruction to relax, which may be the same as the output. | |
[out] | Res | On return, the relaxed instruction. |
Referenced by llvm::MCObjectStreamer::EmitInstruction().
|
inlinevirtual |
lifetime management
Definition at line 48 of file MCAsmBackend.h.
Referenced by llvm::LLVMTargetMachine::addPassesToEmitFile(), and llvm::MCAssembler::reset().
|
pure virtual |
writeNopData - Write an (optimal) nop sequence of Count bytes to the given output. If the target cannot generate such a sequence, it should return an error.
Referenced by writeFragment().
|
protected |
Definition at line 42 of file MCAsmBackend.h.
Referenced by hasDataInCodeSupport().
|
protected |
Definition at line 41 of file MCAsmBackend.h.
Referenced by hasReliableSymbolDifference().