9#ifndef LLVM_MC_MCASMBACKEND_H
10#define LLVM_MC_MCASMBACKEND_H
88 std::unique_ptr<MCObjectWriter>
94 std::unique_ptr<MCObjectWriter>
97 virtual std::unique_ptr<MCObjectTargetWriter>
126 bool IsResolved) = 0;
144 bool Resolved)
const;
160 "Needed if fixupNeedsRelaxation/fixupNeedsRelaxationAdvanced may "
175 int64_t &
Value)
const {
176 return std::make_pair(
false,
false);
210 bool isDarwinCanonicalPersonality(
const MCSymbol *Sym)
const;
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
mir Rename Register Operands
PowerPC TLS Dynamic Call Fixup
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
virtual unsigned getMinimumNopSize() const
Returns the minimum size of a nop in bytes on this target.
MCAsmBackend(const MCAsmBackend &)=delete
const llvm::endianness Endian
bool allowEnhancedRelaxation() const
Return true if this target allows an unrelaxable instruction to be emitted into RelaxableFragment and...
bool allowAutoPadding() const
Return true if this target might automatically pad instructions and thus need to emit padding enable/...
virtual unsigned getMaximumNopSize(const MCSubtargetInfo &STI) const
Returns the maximum size of a nop in bytes on this target.
virtual bool finishLayout(const MCAssembler &Asm) const
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 void relaxInstruction(MCInst &Inst, const MCSubtargetInfo &STI) const
Relax the instruction in the given fragment to the next wider instruction.
MCAsmBackend(llvm::endianness Endian)
virtual MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
virtual bool relaxAlign(MCFragment &F, unsigned &Size)
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 std::pair< bool, bool > relaxLEB128(MCFragment &, int64_t &Value) const
bool AllowEnhancedRelaxation
virtual bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value) const
Simple predicate for targets where !Resolved implies requiring relaxation.
MCAsmBackend & operator=(const MCAsmBackend &)=delete
virtual bool relaxDwarfCFA(MCFragment &) const
virtual std::unique_ptr< MCObjectTargetWriter > createObjectTargetWriter() const =0
virtual void reset()
lifetime management
void setAssembler(MCAssembler *A)
virtual std::optional< MCFixupKind > getFixupKind(StringRef Name) const
Map a relocation name used in .reloc to a fixup kind.
virtual void applyFixup(const MCFragment &, const MCFixup &, const MCValue &Target, uint8_t *Data, uint64_t Value, bool IsResolved)=0
virtual std::optional< bool > evaluateFixup(const MCFragment &, MCFixup &, MCValue &, uint64_t &)
virtual uint64_t generateCompactUnwindEncoding(const MCDwarfFrameInfo *FI, const MCContext *Ctxt) const
Generate the compact unwind encoding for the CFI instructions.
virtual bool relaxDwarfLineAddr(MCFragment &) const
Context object for machine code objects.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Instances of this class represent a single low-level machine instruction.
Streaming object file generation interface.
Base class for classes that define behaviour that is specific to both the target and the object forma...
Defines the object file and target independent interfaces used by the assembler backend to write nati...
Instances of this class represent operands of the MCInst class.
Generic base class for all target subtargets.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
StringRef - Represent a constant reference to a string, i.e.
Target - Wrapper for Target specific information.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
An abstract base class for streams implementations that also support a pwrite operation.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
uint16_t MCFixupKind
Extensible enumeration to represent the type of a fixup.
FunctionAddr VTableAddr Count
FunctionAddr VTableAddr uintptr_t uintptr_t Data
Target independent information on a fixup kind.
const char * Name
A target specific name for the fixup kind.
uint8_t TargetOffset
The bit offset to write the relocation into.
uint8_t TargetSize
The number of bits written by this fixup.
unsigned Flags
Flags describing additional information on this fixup kind.