LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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)
 MachineRelocation (unsigned Offset, unsigned RelocationType, const char *ES, intptr_t cst=0)
unsigned getMachineCodeOffset () const
unsigned getRelocationType () const
intptr_t getConstantVal () const
bool isGlobalValue () const
bool isString () const
bool doesntNeedFunctionStub () const
GlobalValuegetGlobalValue () const
const char * getString () const
void * getResultPointer () const
void setResultPointer (void *Ptr)

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.

Definition at line 36 of file MachineRelocation.h.


Constructor & Destructor Documentation

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

Definition at line 49 of file MachineRelocation.h.

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

Definition at line 59 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 104 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 83 of file MachineRelocation.h.

Referenced by llvm::PPC32JITInfo::relocate().

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

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

Definition at line 110 of file MachineRelocation.h.

References isGlobalValue().

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

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

Definition at line 70 of file MachineRelocation.h.

Referenced by llvm::X86JITInfo::relocate(), llvm::SparcV9JITInfo::relocate(), and llvm::PPC32JITInfo::relocate().

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

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

Definition at line 76 of file MachineRelocation.h.

Referenced by llvm::X86JITInfo::relocate(), llvm::SparcV9JITInfo::relocate(), and llvm::PPC32JITInfo::relocate().

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

Referenced by llvm::X86JITInfo::relocate(), llvm::SparcV9JITInfo::relocate(), and llvm::PPC32JITInfo::relocate().

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

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

Definition at line 117 of file MachineRelocation.h.

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

Referenced by getGlobalValue(), and isString().

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

isString - Return true if this is a constant string.

Definition at line 95 of file MachineRelocation.h.

References isGlobalValue().

Referenced by getString().

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

setResultPointer - Set the result to the specified pointer value.

Definition at line 130 of file MachineRelocation.h.


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