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

 MachineRelocation (unsigned Offset, unsigned RelocationType, GlobalValue *GV, intptr_t cst=0, bool DoesntNeedFunctionStub=0, bool GOTrelative=0)
 MachineRelocation (unsigned Offset, unsigned RelocationType, const char *ES, intptr_t cst=0, bool GOTrelative=0)
 MachineRelocation (unsigned Offset, unsigned RelocationType, unsigned CPI, intptr_t cst=0)
unsigned getMachineCodeOffset () const
unsigned getRelocationType () const
intptr_t getConstantVal () const
bool isGlobalValue () const
bool isString () const
bool isConstantPoolIndex () const
bool isGOTRelative () const
bool doesntNeedFunctionStub () const
GlobalValuegetGlobalValue () const
const char * getString () const
unsigned getConstantPoolIndex () const
void * getResultPointer () const
void setResultPointer (void *Ptr)
void setGOTIndex (unsigned idx)
 setGOTIndex - Set the GOT index to a specific value.
unsigned getGOTIndex () const

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.


Constructor & Destructor Documentation

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

Definition at line 57 of file MachineRelocation.h.

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

Definition at line 69 of file MachineRelocation.h.

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

Definition at line 78 of file MachineRelocation.h.


Member Function Documentation

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 135 of file MachineRelocation.h.

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

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

Definition at line 155 of file MachineRelocation.h.

References isConstantPoolIndex().

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 102 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 141 of file MachineRelocation.h.

References isGlobalValue().

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 180 of file MachineRelocation.h.

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

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

Definition at line 89 of file MachineRelocation.h.

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

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

Definition at line 95 of file MachineRelocation.h.

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 162 of file MachineRelocation.h.

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

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

Definition at line 148 of file MachineRelocation.h.

References isString().

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

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

Definition at line 120 of file MachineRelocation.h.

Referenced by getConstantPoolIndex(), isGlobalValue(), and isString().

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

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

Definition at line 108 of file MachineRelocation.h.

References isConstantPoolIndex().

Referenced by getGlobalValue(), and isString().

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 126 of file MachineRelocation.h.

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

isString - Return true if this is a constant string.

Definition at line 114 of file MachineRelocation.h.

References isConstantPoolIndex(), and isGlobalValue().

Referenced by getString().

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

setGOTIndex - Set the GOT index to a specific value.

Definition at line 173 of file MachineRelocation.h.

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

setResultPointer - Set the result to the specified pointer value.

Definition at line 168 of file MachineRelocation.h.


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