LLVM API Documentation
#include <JIT.h>
Inheritance diagram for llvm::JIT:
Public Member Functions | |
~JIT () | |
TargetJITInfo & | getJITInfo () const |
virtual GenericValue | runFunction (Function *F, const std::vector< GenericValue > &ArgValues) |
void * | getPointerToNamedFunction (const std::string &Name) |
void * | getPointerToFunction (Function *F) |
void * | getOrEmitGlobalVariable (const GlobalVariable *GV) |
void * | getPointerToFunctionOrStub (Function *F) |
void * | recompileAndRelinkFunction (Function *F) |
void | freeMachineCodeForFunction (Function *F) |
Static Public Member Functions | |
static void | Register () |
static ExecutionEngine * | create (ModuleProvider *MP) |
static void | CompilationCallback () |
Definition at line 52 of file lib/ExecutionEngine/JIT/JIT.h.
static void llvm::JIT::CompilationCallback | ( | ) | [static] |
ExecutionEngine * JIT::create | ( | ModuleProvider * | MP | ) | [static] |
create - Create an return a new JIT compiler if there is one available for the current target. Otherwise, return null.
Definition at line 42 of file TargetSelect.cpp.
References Error(), llvm::TargetMachineRegistry::getClosestTargetForJIT(), llvm::TargetMachine::getJITInfo(), llvm::ModuleProvider::getModule(), MArch, MAttrs, MCPU, llvm::ExecutionEngine::MP, and Target.
Referenced by Register().
void JIT::freeMachineCodeForFunction | ( | Function * | F | ) | [virtual] |
freeMachineCodeForFunction - deallocate memory used to code-generate this Function.
Implements llvm::ExecutionEngine.
TargetJITInfo& llvm::JIT::getJITInfo | ( | ) | const [inline] |
getJITInfo - Return the target JIT information structure.
Definition at line 69 of file lib/ExecutionEngine/JIT/JIT.h.
void * JIT::getOrEmitGlobalVariable | ( | const GlobalVariable * | GV | ) | [virtual] |
getOrEmitGlobalVariable - Return the address of the specified global variable, possibly emitting it to memory if needed. This is used by the Emitter.
Reimplemented from llvm::ExecutionEngine.
Definition at line 286 of file JIT.cpp.
References A, abort(), llvm::ExecutionEngine::addGlobalMapping(), llvm::SequentialType::getElementType(), llvm::Value::getName(), llvm::JITState::getPendingGlobals(), llvm::ExecutionEngine::getPointerToGlobalIfAvailable(), llvm::ExecutionEngine::getTargetData(), llvm::GlobalValue::getType(), llvm::TargetData::getTypeAlignment(), llvm::TargetData::getTypeSize(), GV, llvm::GlobalValue::isExternal(), llvm::ExecutionEngine::lock, and llvm::sys::DynamicLibrary::SearchForAddressOfSymbol().
void * JIT::getPointerToFunction | ( | Function * | F | ) | [virtual] |
getPointerToFunction - This returns the address of the specified function, compiling it if necessary.
Implements llvm::ExecutionEngine.
Definition at line 250 of file JIT.cpp.
References abort(), llvm::ExecutionEngine::addGlobalMapping(), F, llvm::ExecutionEngine::getPointerToGlobalIfAvailable(), getPointerToNamedFunction(), llvm::ExecutionEngine::lock, llvm::ModuleProvider::materializeFunction(), and llvm::ExecutionEngine::MP.
Referenced by getPointerToNamedFunction(), recompileAndRelinkFunction(), and runFunction().
void * JIT::getPointerToFunctionOrStub | ( | Function * | F | ) | [virtual] |
getPointerToFunctionOrStub - If the specified function has been code-gen'd, return a pointer to the function. If not, compile it, or use a stub to implement lazy compilation if available.
Reimplemented from llvm::ExecutionEngine.
Definition at line 394 of file JITEmitter.cpp.
References F, getJITResolver(), and llvm::ExecutionEngine::getPointerToGlobalIfAvailable().
void * JIT::getPointerToNamedFunction | ( | const std::string & | Name | ) |
getPointerToNamedFunction - This method returns the address of the specified function by using the dlsym function call. As such it is only useful for resolving library symbols, not code generated symbols.
Definition at line 92 of file Intercept.cpp.
References __mainFunc(), abort(), jit_atexit(), jit_exit(), and llvm::sys::DynamicLibrary::SearchForAddressOfSymbol().
Referenced by getPointerToFunction(), and getPointerToNamedFunction().
void * JIT::recompileAndRelinkFunction | ( | Function * | F | ) | [virtual] |
recompileAndRelinkFunction - This method is used to force a function which has already been compiled, to be compiled again, possibly after it has been modified. Then the entry to the old copy is overwritten with a branch to the new copy. If there was no old copy, this acts just like JIT::getPointerToFunction().
Implements llvm::ExecutionEngine.
Definition at line 321 of file JIT.cpp.
References llvm::ExecutionEngine::addGlobalMapping(), F, getPointerToFunction(), llvm::ExecutionEngine::getPointerToGlobalIfAvailable(), and llvm::TargetJITInfo::replaceMachineCodeForFunction().
static void llvm::JIT::Register | ( | ) | [inline, static] |
Definition at line 63 of file lib/ExecutionEngine/JIT/JIT.h.
References create(), and llvm::ExecutionEngine::JITCtor.
GenericValue JIT::runFunction | ( | Function * | F, | |
const std::vector< GenericValue > & | ArgValues | |||
) | [virtual] |
run - Start execution with the specified function and arguments.
Implements llvm::ExecutionEngine.
Definition at line 71 of file JIT.cpp.
References llvm::ISD::BasicBlock, llvm::Type::BoolTyID, llvm::GenericValue::BoolVal, llvm::CallingConv::C, llvm::Type::DoubleTyID, llvm::GenericValue::DoubleVal, F, llvm::Type::FloatTyID, llvm::GenericValue::FloatVal, llvm::ConstantFP::get(), llvm::ConstantUInt::get(), llvm::ConstantSInt::get(), llvm::ConstantBool::get(), llvm::FunctionType::get(), llvm::ConstantExpr::getCast(), llvm::FunctionType::getNumParams(), llvm::FunctionType::getParamType(), getPointerToFunction(), llvm::FunctionType::getReturnType(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::GVTOP(), llvm::GlobalValue::InternalLinkage, llvm::Type::IntTy, llvm::Type::IntTyID, llvm::GenericValue::IntVal, llvm::FunctionType::isVarArg(), llvm::Type::LongTy, llvm::Type::LongTyID, llvm::GenericValue::LongVal, llvm::Type::PointerTyID, llvm::PTOGV(), RetTy, llvm::Type::SByteTyID, llvm::GenericValue::SByteVal, llvm::CallInst::setTailCall(), llvm::Type::ShortTyID, llvm::GenericValue::ShortVal, llvm::Type::UByteTyID, llvm::GenericValue::UByteVal, llvm::Type::UIntTy, llvm::Type::UIntTyID, llvm::GenericValue::UIntVal, llvm::Type::ULongTyID, llvm::GenericValue::ULongVal, llvm::Type::UShortTyID, llvm::GenericValue::UShortVal, llvm::Type::VoidTy, and llvm::Type::VoidTyID.