LLVM API Documentation

llvm::MachineRelocation Class Reference

#include <MachineRelocation.h>

Collaboration diagram for llvm::MachineRelocation:

Collaboration graph
[legend]
List of all members.

Public Member Functions

intptr_t getMachineCodeOffset () const
unsigned getRelocationType () const
intptr_t getConstantVal () const
bool isGlobalValue () const
bool isString () const
bool isConstantPoolIndex () const
bool isJumpTableIndex () const
bool isGOTRelative () const
bool doesntNeedFunctionStub () const
GlobalValuegetGlobalValue () const
const char * getString () 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.
unsigned getGOTIndex () const

Static Public Member Functions

static MachineRelocation getGV (intptr_t offset, unsigned RelocationType, GlobalValue *GV, intptr_t cst=0, bool DoesntNeedFunctionStub=0, bool GOTrelative=0)
static MachineRelocation getExtSym (intptr_t offset, unsigned RelocationType, const char *ES, intptr_t cst=0, bool GOTrelative=0)
static MachineRelocation getConstPool (intptr_t offset, unsigned RelocationType, unsigned CPI, intptr_t cst=0)
static MachineRelocation getJumpTable (intptr_t offset, unsigned RelocationType, unsigned JTI, intptr_t cst=0)

Detailed Description

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: 1. An offset in the machine code buffer, the location to modify. 2. A target specific relocation type (a number from 0 to 63). 3. A symbol being referenced, either as a GlobalValue* or as a string. 4. An optional constant value to be added to the reference. 5. A bit, CanRewrite, which indicates to the JIT that a function stub is not needed for the relocation. 6. An index into the GOT, if the target uses a GOT

Definition at line 37 of file MachineRelocation.h.


Member Function Documentation

static MachineRelocation llvm::MachineRelocation::getGV ( intptr_t  offset,
unsigned  RelocationType,
GlobalValue GV,
intptr_t  cst = 0,
bool  DoesntNeedFunctionStub = 0,
bool  GOTrelative = 0 
) [inline, static]

MachineRelocation::getGV - Return a relocation entry for a GlobalValue.

Definition at line 70 of file MachineRelocation.h.

References AddrType, ConstantVal, DoesntNeedFnStub, GOTRelative, GV, Offset, Target, and TargetReloType.

static MachineRelocation llvm::MachineRelocation::getExtSym ( intptr_t  offset,
unsigned  RelocationType,
const char *  ES,
intptr_t  cst = 0,
bool  GOTrelative = 0 
) [inline, static]

MachineRelocation::getExtSym - Return a relocation entry for an external symbol, like "free".

Definition at line 89 of file MachineRelocation.h.

References AddrType, ConstantVal, DoesntNeedFnStub, ExtSym, GOTRelative, Offset, Target, and TargetReloType.

static MachineRelocation llvm::MachineRelocation::getConstPool ( intptr_t  offset,
unsigned  RelocationType,
unsigned  CPI,
intptr_t  cst = 0 
) [inline, static]

MachineRelocation::getConstPool - Return a relocation entry for a constant pool entry.

Definition at line 107 of file MachineRelocation.h.

References AddrType, ConstantVal, DoesntNeedFnStub, GOTRelative, Index, Offset, Target, and TargetReloType.

static MachineRelocation llvm::MachineRelocation::getJumpTable ( intptr_t  offset,
unsigned  RelocationType,
unsigned  JTI,
intptr_t  cst = 0 
) [inline, static]

MachineRelocation::getJumpTable - Return a relocation entry for a jump table entry.

Definition at line 124 of file MachineRelocation.h.

References AddrType, ConstantVal, DoesntNeedFnStub, GOTRelative, Index, Offset, Target, and TargetReloType.

intptr_t llvm::MachineRelocation::getMachineCodeOffset (  )  const [inline]

getMachineCodeOffset - Return the offset into the code buffer that the relocation should be performed.

Definition at line 140 of file MachineRelocation.h.

unsigned llvm::MachineRelocation::getRelocationType (  )  const [inline]

getRelocationType - Return the target-specific relocation ID for this relocation.

Definition at line 146 of file MachineRelocation.h.

intptr_t llvm::MachineRelocation::getConstantVal (  )  const [inline]

getConstantVal - Get the constant value associated with this relocation. This is often an offset from the symbol.

Definition at line 153 of file MachineRelocation.h.

bool llvm::MachineRelocation::isGlobalValue (  )  const [inline]

isGlobalValue - Return true if this relocation is a GlobalValue, as opposed to a constant string.

Definition at line 159 of file MachineRelocation.h.

Referenced by getGlobalValue().

bool llvm::MachineRelocation::isString (  )  const [inline]

isString - Return true if this is a constant string.

Definition at line 165 of file MachineRelocation.h.

Referenced by getString().

bool llvm::MachineRelocation::isConstantPoolIndex (  )  const [inline]

isConstantPoolIndex - Return true if this is a constant pool reference.

Definition at line 171 of file MachineRelocation.h.

Referenced by getConstantPoolIndex().

bool llvm::MachineRelocation::isJumpTableIndex (  )  const [inline]

isJumpTableIndex - Return true if this is a jump table reference.

Definition at line 177 of file MachineRelocation.h.

Referenced by getJumpTableIndex().

bool llvm::MachineRelocation::isGOTRelative (  )  const [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 183 of file MachineRelocation.h.

bool llvm::MachineRelocation::doesntNeedFunctionStub (  )  const [inline]

doesntNeedFunctionStub - This function returns true if the JIT for this target is capable of directly handling the relocated instruction without using a stub function. It is always conservatively correct for this flag to be false, but targets can improve their compilation callback functions to handle more general cases if they want improved performance.

Definition at line 192 of file MachineRelocation.h.

GlobalValue* llvm::MachineRelocation::getGlobalValue (  )  const [inline]

getGlobalValue - If this is a global value reference, return the referenced global.

Definition at line 198 of file MachineRelocation.h.

References isGlobalValue().

const char* llvm::MachineRelocation::getString (  )  const [inline]

getString - If this is a string value, return the string reference.

Definition at line 205 of file MachineRelocation.h.

References isString().

unsigned llvm::MachineRelocation::getConstantPoolIndex (  )  const [inline]

getConstantPoolIndex - If this is a const pool reference, return the index into the constant pool.

Definition at line 212 of file MachineRelocation.h.

References isConstantPoolIndex().

unsigned llvm::MachineRelocation::getJumpTableIndex (  )  const [inline]

getJumpTableIndex - If this is a jump table reference, return the index into the jump table.

Definition at line 219 of file MachineRelocation.h.

References isJumpTableIndex().

void* llvm::MachineRelocation::getResultPointer (  )  const [inline]

getResultPointer - Once this has been resolved to point to an actual address, this returns the pointer.

Definition at line 226 of file MachineRelocation.h.

void llvm::MachineRelocation::setResultPointer ( void *  Ptr  )  [inline]

setResultPointer - Set the result to the specified pointer value.

Definition at line 233 of file MachineRelocation.h.

void llvm::MachineRelocation::setGOTIndex ( unsigned  idx  )  [inline]

setGOTIndex - Set the GOT index to a specific value.

Definition at line 239 of file MachineRelocation.h.

unsigned llvm::MachineRelocation::getGOTIndex (  )  const [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 247 of file MachineRelocation.h.


The documentation for this class was generated from the following file: