LLVM API Documentation
#include <MachineRelocation.h>
Public Types | |
enum | RelocationType { VANILLA } |
Public Member Functions | |
intptr_t | getMachineCodeOffset () const |
unsigned | getRelocationType () const |
intptr_t | getConstantVal () const |
void | setConstantVal (intptr_t val) |
bool | isGlobalValue () const |
bool | isIndirectSymbol () const |
bool | isBasicBlock () const |
bool | isExternalSymbol () const |
bool | isConstantPoolIndex () const |
bool | isJumpTableIndex () const |
bool | isGOTRelative () const |
bool | mayNeedFarStub () const |
bool | letTargetResolve () const |
GlobalValue * | getGlobalValue () const |
MachineBasicBlock * | getBasicBlock () const |
const char * | getExternalSymbol () const |
unsigned | getConstantPoolIndex () const |
unsigned | getJumpTableIndex () const |
void * | getResultPointer () const |
void | setResultPointer (void *Ptr) |
void | setGOTIndex (unsigned idx) |
setGOTIndex - Set the GOT index to a specific value. More... | |
unsigned | getGOTIndex () const |
Static Public Member Functions | |
static MachineRelocation | getGV (uintptr_t offset, unsigned RelocationType, GlobalValue *GV, intptr_t cst=0, bool MayNeedFarStub=0, bool GOTrelative=0) |
static MachineRelocation | getIndirectSymbol (uintptr_t offset, unsigned RelocationType, GlobalValue *GV, intptr_t cst=0, bool MayNeedFarStub=0, bool GOTrelative=0) |
static MachineRelocation | getBB (uintptr_t offset, unsigned RelocationType, MachineBasicBlock *MBB, intptr_t cst=0) |
static MachineRelocation | getExtSym (uintptr_t offset, unsigned RelocationType, const char *ES, intptr_t cst=0, bool GOTrelative=0, bool NeedStub=true) |
static MachineRelocation | getConstPool (uintptr_t offset, unsigned RelocationType, unsigned CPI, intptr_t cst=0, bool letTargetResolve=false) |
static MachineRelocation | getJumpTable (uintptr_t offset, unsigned RelocationType, unsigned JTI, intptr_t cst=0, bool letTargetResolve=false) |
MachineRelocation - This represents a target-specific relocation value, produced by the code emitter. This relocation is resolved after the has been emitted, either to an object file or to memory, when the target of the relocation can be resolved.
A relocation is made up of the following logical portions:
Definition at line 38 of file MachineRelocation.h.
Enumerator | |
---|---|
VANILLA |
Definition at line 76 of file MachineRelocation.h.
|
inline |
Definition at line 286 of file MachineRelocation.h.
References isBasicBlock().
|
inlinestatic |
MachineRelocation::getBB - Return a relocation entry for a BB.
Definition at line 121 of file MachineRelocation.h.
|
inline |
getConstantPoolIndex - If this is a const pool reference, return the index into the constant pool.
Definition at line 300 of file MachineRelocation.h.
References isConstantPoolIndex().
|
inline |
getConstantVal - Get the constant value associated with this relocation. This is often an offset from the symbol.
Definition at line 209 of file MachineRelocation.h.
Referenced by llvm::PPCJITInfo::relocate(), and llvm::X86JITInfo::relocate().
|
inlinestatic |
MachineRelocation::getConstPool - Return a relocation entry for a constant pool entry.
Definition at line 159 of file MachineRelocation.h.
References Index, letTargetResolve(), and Result.
|
inline |
getString - If this is a string value, return the string reference.
Definition at line 293 of file MachineRelocation.h.
References isExternalSymbol().
|
inlinestatic |
MachineRelocation::getExtSym - Return a relocation entry for an external symbol, like "free".
Definition at line 139 of file MachineRelocation.h.
|
inline |
getGlobalValue - If this is a global value reference, return the referenced global.
Definition at line 280 of file MachineRelocation.h.
References isGlobalValue(), and isIndirectSymbol().
|
inline |
getGOTIndex - Once this has been resolved to an entry in the GOT, this returns that index. The index is from the lowest address entry in the GOT.
Definition at line 335 of file MachineRelocation.h.
|
inlinestatic |
MachineRelocation::getGV - Return a relocation entry for a GlobalValue.
Definition at line 82 of file MachineRelocation.h.
|
inlinestatic |
MachineRelocation::getIndirectSymbol - Return a relocation entry for an indirect symbol.
Definition at line 101 of file MachineRelocation.h.
|
inlinestatic |
MachineRelocation::getJumpTable - Return a relocation entry for a jump table entry.
Definition at line 178 of file MachineRelocation.h.
References Index, letTargetResolve(), and Result.
|
inline |
getJumpTableIndex - If this is a jump table reference, return the index into the jump table.
Definition at line 307 of file MachineRelocation.h.
References isJumpTableIndex().
|
inline |
getMachineCodeOffset - Return the offset into the code buffer that the relocation should be performed.
Definition at line 196 of file MachineRelocation.h.
Referenced by llvm::PPCJITInfo::relocate(), llvm::SparcJITInfo::relocate(), llvm::MipsJITInfo::relocate(), llvm::X86JITInfo::relocate(), and llvm::ARMJITInfo::relocate().
|
inline |
getRelocationType - Return the target-specific relocation ID for this relocation.
Definition at line 202 of file MachineRelocation.h.
Referenced by llvm::PPCJITInfo::relocate(), llvm::SparcJITInfo::relocate(), llvm::MipsJITInfo::relocate(), llvm::X86JITInfo::relocate(), and llvm::ARMJITInfo::relocate().
|
inline |
getResultPointer - Once this has been resolved to point to an actual address, this returns the pointer.
Definition at line 314 of file MachineRelocation.h.
Referenced by llvm::PPCJITInfo::relocate(), llvm::SparcJITInfo::relocate(), llvm::MipsJITInfo::relocate(), and llvm::X86JITInfo::relocate().
|
inline |
isBasicBlock - Return true if this relocation is a basic block reference.
Definition at line 234 of file MachineRelocation.h.
Referenced by getBasicBlock().
|
inline |
isConstantPoolIndex - Return true if this is a constant pool reference.
Definition at line 246 of file MachineRelocation.h.
Referenced by getConstantPoolIndex().
|
inline |
isExternalSymbol - Return true if this is a constant string.
Definition at line 240 of file MachineRelocation.h.
Referenced by getExternalSymbol().
|
inline |
isGlobalValue - Return true if this relocation is a GlobalValue, as opposed to a constant string.
Definition at line 222 of file MachineRelocation.h.
Referenced by getGlobalValue().
|
inline |
isGOTRelative - Return true the target wants the index into the GOT of the symbol rather than the address of the symbol.
Definition at line 258 of file MachineRelocation.h.
|
inline |
isIndirectSymbol - Return true if this relocation is the address an indirect symbol
Definition at line 228 of file MachineRelocation.h.
Referenced by getGlobalValue().
|
inline |
isJumpTableIndex - Return true if this is a jump table reference.
Definition at line 252 of file MachineRelocation.h.
Referenced by getJumpTableIndex().
|
inline |
letTargetResolve - Return true if the target JITInfo is usually responsible for resolving the address of this relocation.
Definition at line 274 of file MachineRelocation.h.
Referenced by getConstPool(), and getJumpTable().
|
inline |
mayNeedFarStub - This function returns true if the JIT for this target may need either a stub function or an indirect global-variable load to handle the relocated GlobalValue reference. For example, the x86-64 call instruction can only call functions within +/-2GB of the call site. Anything farther away needs a longer mov+call sequence, which can't just be written on top of the existing call.
Definition at line 268 of file MachineRelocation.h.
|
inline |
setConstantVal - Set the constant value associated with this relocation. This is often an offset from the symbol.
Definition at line 216 of file MachineRelocation.h.
|
inline |
setGOTIndex - Set the GOT index to a specific value.
Definition at line 327 of file MachineRelocation.h.
|
inline |
setResultPointer - Set the result to the specified pointer value.
Definition at line 321 of file MachineRelocation.h.
const char* llvm::MachineRelocation::ExtSym |
Definition at line 61 of file MachineRelocation.h.
Referenced by getExtSym().
unsigned llvm::MachineRelocation::GOTIndex |
Definition at line 63 of file MachineRelocation.h.
GlobalValue* llvm::MachineRelocation::GV |
Definition at line 59 of file MachineRelocation.h.
Referenced by getGV(), and getIndirectSymbol().
unsigned llvm::MachineRelocation::Index |
Definition at line 62 of file MachineRelocation.h.
Referenced by getConstPool(), and getJumpTable().
MachineBasicBlock* llvm::MachineRelocation::MBB |
Definition at line 60 of file MachineRelocation.h.
Referenced by getBB().
void* llvm::MachineRelocation::Result |
Definition at line 58 of file MachineRelocation.h.
Referenced by getBB(), getConstPool(), getExtSym(), getGV(), getIndirectSymbol(), and getJumpTable().