class MCFixup
Declaration
class MCFixup { /* full declaration omitted */ };
Description
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction) which requires assemble- or run- time patching. Fixups are used any time the target instruction encoder needs to represent some value in an instruction which is not yet concrete. The encoder will encode the instruction assuming the value is 0, and emit a fixup which communicates to the assembler backend how it should rewrite the encoded value. During the process of relaxation, the assembler will apply fixups as symbolic values become concrete. When relaxation is complete, any remaining fixups become relocations in the object file (or errors, if the fixup cannot be encoded on the target).
Declared at: llvm/include/llvm/MC/MCFixup.h:71
Member Variables
- private const llvm::MCExpr* Value = nullptr
- The value to put into the fixup location. The exact interpretation of the expression is target dependent, usually it will be one of the operands to an instruction or an assembler directive.
- private uint32_t Offset = 0
- The byte index of start of the relocation inside the MCFragment.
- private llvm::MCFixupKind Kind = FK_NONE
- The target dependent kind of fixup item this is. The kind is used to determine how the operand value should be encoded into the instruction.
- private llvm::SMLoc Loc
- The source location which gave rise to the fixup, if any.
Method Overview
- public static llvm::MCFixup create(uint32_t Offset, const llvm::MCExpr * Value, llvm::MCFixupKind Kind, llvm::SMLoc Loc = llvm::SMLoc())
- public llvm::MCFixupKind getKind() const
- public static llvm::MCFixupKind getKindForSize(unsigned int Size, bool IsPCRel)
- public static llvm::MCFixupKind getKindForSizeInBits(unsigned int Size, bool IsPCRel)
- public llvm::SMLoc getLoc() const
- public uint32_t getOffset() const
- public unsigned int getTargetKind() const
- public const llvm::MCExpr * getValue() const
- public void setOffset(uint32_t Value)
Methods
¶static llvm::MCFixup create(
uint32_t Offset,
const llvm::MCExpr* Value,
llvm::MCFixupKind Kind,
llvm::SMLoc Loc = llvm::SMLoc())
static llvm::MCFixup create(
uint32_t Offset,
const llvm::MCExpr* Value,
llvm::MCFixupKind Kind,
llvm::SMLoc Loc = llvm::SMLoc())
Declared at: llvm/include/llvm/MC/MCFixup.h:87
Parameters
- uint32_t Offset
- const llvm::MCExpr* Value
- llvm::MCFixupKind Kind
- llvm::SMLoc Loc = llvm::SMLoc()
¶llvm::MCFixupKind getKind() const
llvm::MCFixupKind getKind() const
Declared at: llvm/include/llvm/MC/MCFixup.h:98
¶static llvm::MCFixupKind getKindForSize(
unsigned int Size,
bool IsPCRel)
static llvm::MCFixupKind getKindForSize(
unsigned int Size,
bool IsPCRel)
Description
Return the generic fixup kind for a value with the given size. It is an error to pass an unsupported size.
Declared at: llvm/include/llvm/MC/MCFixup.h:109
Parameters
- unsigned int Size
- bool IsPCRel
¶static llvm::MCFixupKind getKindForSizeInBits(
unsigned int Size,
bool IsPCRel)
static llvm::MCFixupKind getKindForSizeInBits(
unsigned int Size,
bool IsPCRel)
Description
Return the generic fixup kind for a value with the given size in bits. It is an error to pass an unsupported size.
Declared at: llvm/include/llvm/MC/MCFixup.h:125
Parameters
- unsigned int Size
- bool IsPCRel
¶llvm::SMLoc getLoc() const
llvm::SMLoc getLoc() const
Declared at: llvm/include/llvm/MC/MCFixup.h:143
¶uint32_t getOffset() const
uint32_t getOffset() const
Declared at: llvm/include/llvm/MC/MCFixup.h:102
¶unsigned int getTargetKind() const
unsigned int getTargetKind() const
Declared at: llvm/include/llvm/MC/MCFixup.h:100
¶const llvm::MCExpr* getValue() const
const llvm::MCExpr* getValue() const
Declared at: llvm/include/llvm/MC/MCFixup.h:105
¶void setOffset(uint32_t Value)
void setOffset(uint32_t Value)
Declared at: llvm/include/llvm/MC/MCFixup.h:103
Parameters
- uint32_t Value