LLVM API Documentation
#include <TargetJITInfo.h>
Inheritance diagram for llvm::TargetJITInfo:
Public Types | |
typedef void(*) | LazyResolverFn () |
typedef void *(*) | JITCompilerFn (void *) |
Public Member Functions | |
virtual | ~TargetJITInfo () |
virtual void | addPassesToJITCompile (FunctionPassManager &PM)=0 |
virtual void | replaceMachineCodeForFunction (void *Old, void *New)=0 |
virtual void * | emitFunctionStub (void *Fn, MachineCodeEmitter &MCE) |
virtual LazyResolverFn | getLazyResolverFunction (JITCompilerFn) |
virtual void | relocate (void *Function, MachineRelocation *MR, unsigned NumRelocs, unsigned char *GOTBase) |
virtual void | resolveBBRefs (MachineCodeEmitter &MCE) |
virtual void | synchronizeICache (const void *Addr, size_t len) |
void | addBBRef (MachineBasicBlock *BB, intptr_t PC) |
bool | needsGOT () const |
needsGOT - Allows a target to specify that it would like the | |
Protected Attributes | |
bool | useGOT |
std::vector< std::pair< MachineBasicBlock *, intptr_t > > | BBRefs |
Definition at line 32 of file TargetJITInfo.h.
typedef void(*) llvm::TargetJITInfo::LazyResolverFn() |
LazyResolverFn - This typedef is used to represent the function that unresolved call points should invoke. This is a target specific function that knows how to walk the stack and find out which stub the call is coming from.
Definition at line 60 of file TargetJITInfo.h.
typedef void*(*) llvm::TargetJITInfo::JITCompilerFn(void *) |
JITCompilerFn - This typedef is used to represent the JIT function that lazily compiles the function corresponding to a stub. The JIT keeps track of the mapping between stubs and LLVM Functions, the target provides the ability to figure out the address of a stub that is called by the LazyResolverFn.
Definition at line 67 of file TargetJITInfo.h.
virtual llvm::TargetJITInfo::~TargetJITInfo | ( | ) | [inline, virtual] |
Definition at line 34 of file TargetJITInfo.h.
virtual void llvm::TargetJITInfo::addPassesToJITCompile | ( | FunctionPassManager & | PM | ) | [pure virtual] |
addPassesToJITCompile - Add passes to the specified pass manager to implement a fast code generator for this target.
Implemented in llvm::AlphaJITInfo, llvm::PPCJITInfo, and llvm::X86JITInfo.
virtual void llvm::TargetJITInfo::replaceMachineCodeForFunction | ( | void * | Old, | |
void * | New | |||
) | [pure virtual] |
replaceMachineCodeForFunction - Make it so that calling the function whose machine code is at OLD turns into a call to NEW, perhaps by overwriting OLD with a branch to NEW. This is used for self-modifying code.
Implemented in llvm::AlphaJITInfo, llvm::PPCJITInfo, and llvm::X86JITInfo.
Referenced by llvm::JIT::recompileAndRelinkFunction().
virtual void* llvm::TargetJITInfo::emitFunctionStub | ( | void * | Fn, | |
MachineCodeEmitter & | MCE | |||
) | [inline, virtual] |
emitFunctionStub - Use the specified MachineCodeEmitter object to emit a small native function that simply calls the function at the specified address. Return the address of the resultant function.
Reimplemented in llvm::AlphaJITInfo, llvm::PPCJITInfo, and llvm::X86JITInfo.
Definition at line 51 of file TargetJITInfo.h.
virtual LazyResolverFn llvm::TargetJITInfo::getLazyResolverFunction | ( | JITCompilerFn | ) | [inline, virtual] |
getLazyResolverFunction - This method is used to initialize the JIT, giving the target the function that should be used to compile a function, and giving the JIT the target function used to do the lazy resolving.
Definition at line 73 of file TargetJITInfo.h.
virtual void llvm::TargetJITInfo::relocate | ( | void * | Function, | |
MachineRelocation * | MR, | |||
unsigned | NumRelocs, | |||
unsigned char * | GOTBase | |||
) | [inline, virtual] |
relocate - Before the JIT can run a block of code that has been emitted, it must rewrite the code to contain the actual addresses of any referenced global symbols.
Reimplemented in llvm::AlphaJITInfo, llvm::PPCJITInfo, and llvm::X86JITInfo.
Definition at line 81 of file TargetJITInfo.h.
virtual void llvm::TargetJITInfo::resolveBBRefs | ( | MachineCodeEmitter & | MCE | ) | [inline, virtual] |
resolveBBRefs - Resolve branches to BasicBlocks for the JIT emitted function.
Reimplemented in llvm::AlphaJITInfo, llvm::PPCJITInfo, and llvm::X86JITInfo.
Definition at line 88 of file TargetJITInfo.h.
virtual void llvm::TargetJITInfo::synchronizeICache | ( | const void * | Addr, | |
size_t | len | |||
) | [inline, virtual] |
synchronizeICache - On some targets, the JIT emitted code must be explicitly refetched to ensure correct execution.
Reimplemented in llvm::PPCJITInfo.
Definition at line 92 of file TargetJITInfo.h.
void llvm::TargetJITInfo::addBBRef | ( | MachineBasicBlock * | BB, | |
intptr_t | PC | |||
) | [inline] |
addBBRef - Add a BasicBlock reference to be resolved after the function is emitted.
Definition at line 96 of file TargetJITInfo.h.
bool llvm::TargetJITInfo::needsGOT | ( | ) | const [inline] |
needsGOT - Allows a target to specify that it would like the
Definition at line 102 of file TargetJITInfo.h.
References useGOT.
bool llvm::TargetJITInfo::useGOT [protected] |
Definition at line 105 of file TargetJITInfo.h.
Referenced by llvm::AlphaJITInfo::AlphaJITInfo(), needsGOT(), llvm::PPCJITInfo::PPCJITInfo(), and llvm::X86JITInfo::X86JITInfo().
std::vector<std::pair<MachineBasicBlock*, intptr_t> > llvm::TargetJITInfo::BBRefs [protected] |
Definition at line 108 of file TargetJITInfo.h.
Referenced by addBBRef(), llvm::X86JITInfo::resolveBBRefs(), llvm::PPCJITInfo::resolveBBRefs(), and llvm::AlphaJITInfo::resolveBBRefs().