|
LLVM
3.7.0
|
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_pwrite_stream &OS) const =0 |
| Create a new MCObjectWriter instance for use by the assembler backend to emit the final object file. More... | |
| virtual MCELFObjectTargetWriter * | createELFObjectTargetWriter () const |
| Create a new ELFObjectTargetWriter to enable non-standard ELFObjectWriters. More... | |
| bool | hasDataInCodeSupport () const |
| Check whether this target implements data-in-code markers. More... | |
| virtual unsigned | getMinimumNopSize () const |
| Returns the minimum size of a nop in bytes on this target. More... | |
| virtual bool | writeNopData (uint64_t Count, MCObjectWriter *OW) const =0 |
| Write an (optimal) nop sequence of Count bytes to the given output. More... | |
| virtual void | handleAssemblerFlag (MCAssemblerFlag Flag) |
| Handle any target-specific assembler flags. By default, do nothing. More... | |
| 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 |
| Get the number of target specific fixup kinds. More... | |
| virtual const MCFixupKindInfo & | getFixupKindInfo (MCFixupKind Kind) const |
| Get information on a fixup kind. More... | |
| 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. More... | |
| 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 and following the fixup kind as appropriate. More... | |
Target Relaxation Interfaces | |
| virtual bool | mayNeedRelaxation (const MCInst &Inst) const =0 |
| Check whether the given instruction may need relaxation. More... | |
| 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. More... | |
| 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. More... | |
| virtual void | relaxInstruction (const MCInst &Inst, MCInst &Res) const =0 |
| Relax the instruction in the given fragment to the next wider instruction. More... | |
Protected Member Functions | |
| MCAsmBackend () | |
Protected Attributes | |
| unsigned | HasDataInCodeSupport: 1 |
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 17 of file MCAsmBackend.cpp.
|
pure virtual |
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.
Implemented in llvm::MipsAsmBackend.
Referenced by llvm::MCAssembler::Finish().
|
inlinevirtual |
Create a new ELFObjectTargetWriter to enable non-standard ELFObjectWriters.
Definition at line 55 of file MCAsmBackend.h.
References llvm_unreachable.
|
pure virtual |
Create a new MCObjectWriter instance for use by the assembler backend to emit the final object file.
Implemented in llvm::MipsAsmBackend.
|
pure virtual |
Simple predicate for targets where !Resolved implies requiring relaxation.
Implemented in llvm::MipsAsmBackend.
Referenced by fixupNeedsRelaxationAdvanced().
|
virtual |
Target specific predicate for whether a given fixup requires the associated instruction to be relaxed.
Definition at line 42 of file MCAsmBackend.cpp.
References fixupNeedsRelaxation().
|
inlinevirtual |
Generate the compact unwind encoding for the CFI instructions.
Definition at line 136 of file MCAsmBackend.h.
Referenced by llvm::MCStreamer::generateCompactUnwindEncodings().
|
virtual |
Get information on a fixup kind.
Reimplemented in llvm::MipsAsmBackend.
Definition at line 19 of file MCAsmBackend.cpp.
References llvm::array_lengthof(), llvm::MCFixupKindInfo::FKF_IsPCRel, and Kind.
Referenced by llvm::MipsAsmBackend::getFixupKindInfo(), and llvm::MachObjectWriter::isFixupKindPCRel().
|
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 123 of file MCAsmBackend.h.
Referenced by llvm::MCAssembler::computeFragmentSize().
|
pure virtual |
Get the number of target specific fixup kinds.
Implemented in llvm::MipsAsmBackend.
|
inlinevirtual |
Handle any target-specific assembler flags. By default, do nothing.
Definition at line 132 of file MCAsmBackend.h.
Referenced by llvm::MCELFStreamer::EmitAssemblerFlag().
|
inline |
Check whether this target implements data-in-code markers.
If not, data region directives will be ignored.
Definition at line 62 of file MCAsmBackend.h.
References HasDataInCodeSupport.
Check whether the given instruction may need relaxation.
| Inst | - The instruction to test. |
Implemented in llvm::MipsAsmBackend.
Referenced by llvm::MCObjectStreamer::EmitInstruction().
|
inlinevirtual |
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.
Reimplemented in llvm::MipsAsmBackend.
Definition at line 76 of file MCAsmBackend.h.
|
pure virtual |
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. |
Implemented in llvm::MipsAsmBackend.
Referenced by llvm::MCObjectStreamer::EmitInstruction().
|
inlinevirtual |
lifetime management
Definition at line 47 of file MCAsmBackend.h.
Referenced by llvm::MCAssembler::reset().
|
pure virtual |
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.
Implemented in llvm::MipsAsmBackend.
Referenced by writeFragment().
|
protected |
Definition at line 41 of file MCAsmBackend.h.
Referenced by hasDataInCodeSupport().
1.8.6