LLVM API Documentation
#include <MCJIT.h>


Public Member Functions | |
| ~MCJIT () | |
ExecutionEngine interface implementation | |
| virtual void * | getPointerToBasicBlock (BasicBlock *BB) |
| virtual void * | getPointerToFunction (Function *F) |
| virtual void * | recompileAndRelinkFunction (Function *F) |
| virtual void | freeMachineCodeForFunction (Function *F) |
| virtual GenericValue | runFunction (Function *F, const std::vector< GenericValue > &ArgValues) |
| virtual void * | getPointerToNamedFunction (const std::string &Name, bool AbortOnFailure=true) |
| virtual void | mapSectionAddress (void *LocalAddress, uint64_t TargetAddress) |
Static Public Member Functions | |
(Private) Registration Interfaces | |
| static void | Register () |
| static ExecutionEngine * | createJIT (Module *M, std::string *ErrorStr, JITMemoryManager *JMM, bool GVsWithCode, TargetMachine *TM) |
Definition at line 25 of file lib/ExecutionEngine/MCJIT/MCJIT.h.
| ExecutionEngine * MCJIT::createJIT | ( | Module * | M, |
| std::string * | ErrorStr, | ||
| JITMemoryManager * | JMM, | ||
| bool | GVsWithCode, | ||
| TargetMachine * | TM | ||
| ) | [static] |
Definition at line 36 of file MCJIT.cpp.
References llvm::TargetMachine::getJITInfo(), and llvm::sys::DynamicLibrary::LoadLibraryPermanently().
Referenced by Register().
| void MCJIT::freeMachineCodeForFunction | ( | Function * | F | ) | [virtual] |
freeMachineCodeForFunction - Release memory in the ExecutionEngine corresponding to the machine code emitted to execute this function, useful for garbage-collecting generated code.
Implements llvm::ExecutionEngine.
Definition at line 115 of file MCJIT.cpp.
References llvm::report_fatal_error().
| void * MCJIT::getPointerToBasicBlock | ( | BasicBlock * | BB | ) | [virtual] |
getPointerToBasicBlock - The different EE's represent basic blocks in different ways. Return the representation for a blockaddress of the specified block.
Implements llvm::ExecutionEngine.
Definition at line 91 of file MCJIT.cpp.
References llvm::report_fatal_error().
| void * MCJIT::getPointerToFunction | ( | Function * | F | ) | [virtual] |
getPointerToFunction - The different EE's represent function bodies in different ways. They should each implement this to say what a function pointer should look like. When F is destroyed, the ExecutionEngine will remove its global mapping and free any machine code. Be sure no threads are running inside F when that happens.
Implements llvm::ExecutionEngine.
Definition at line 95 of file MCJIT.cpp.
References llvm::ExecutionEngine::addGlobalMapping(), llvm::MCAsmInfo::getGlobalPrefix(), llvm::TargetMachine::getMCAsmInfo(), llvm::Value::getName(), getPointerToNamedFunction(), llvm::RuntimeDyld::getSymbolAddress(), llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::GlobalValue::hasExternalWeakLinkage(), llvm::GlobalValue::isDeclaration(), and llvm::StringRef::substr().
Referenced by runFunction().
| void * MCJIT::getPointerToNamedFunction | ( | const std::string & | Name, |
| bool | AbortOnFailure = true |
||
| ) | [virtual] |
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.
If AbortOnFailure is false and no function with the given name is found, this function silently returns a null pointer. Otherwise, it prints a message to stderr and aborts.
getPointerToNamedFunction - This method returns the address of the specified function by using the dynamic loader interface. As such it is only useful for resolving library symbols, not code generated symbols.
If a LazyFunctionCreator is installed, use it to get/create the function.
Implements llvm::ExecutionEngine.
Definition at line 103 of file MCJIT/Intercept.cpp.
References llvm::ExecutionEngine::isSymbolSearchingDisabled(), jit_atexit(), jit_exit(), jit_noop(), llvm::ExecutionEngine::LazyFunctionCreator, llvm::cl::Prefix, llvm::report_fatal_error(), and llvm::sys::DynamicLibrary::SearchForAddressOfSymbol().
Referenced by getPointerToFunction().
| virtual void llvm::MCJIT::mapSectionAddress | ( | void * | LocalAddress, |
| uint64_t | TargetAddress | ||
| ) | [inline, virtual] |
mapSectionAddress - map a section to its target address space value. Map the address of a JIT section as returned from the memory manager to the address in the target process as the running code will see it. This is the address which will be used for relocation resolution.
Reimplemented from llvm::ExecutionEngine.
Definition at line 74 of file lib/ExecutionEngine/MCJIT/MCJIT.h.
References llvm::RuntimeDyld::mapSectionAddress().
| void * MCJIT::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 VM::getPointerToFunction().
Implements llvm::ExecutionEngine.
Definition at line 111 of file MCJIT.cpp.
References llvm::report_fatal_error().
| static void llvm::MCJIT::Register | ( | ) | [inline, static] |
Definition at line 82 of file lib/ExecutionEngine/MCJIT/MCJIT.h.
References createJIT(), and llvm::ExecutionEngine::MCJITCtor.
| GenericValue MCJIT::runFunction | ( | Function * | F, |
| const std::vector< GenericValue > & | ArgValues | ||
| ) | [virtual] |
runFunction - Execute the specified function with the specified arguments, and return the result.
Implements llvm::ExecutionEngine.
Definition at line 119 of file MCJIT.cpp.
References llvm::Type::DoubleTyID, llvm::GenericValue::DoubleVal, llvm::Type::FloatTyID, llvm::GenericValue::FloatVal, llvm::Type::FP128TyID, getBitWidth(), llvm::Function::getFunctionType(), llvm::FunctionType::getNumParams(), llvm::FunctionType::getParamType(), getPointerToFunction(), llvm::FunctionType::getReturnType(), llvm::Type::getTypeID(), llvm::GVTOP(), llvm::Type::IntegerTyID, llvm::GenericValue::IntVal, llvm::tgtok::IntVal, llvm::Type::isIntegerTy(), llvm::Type::isPointerTy(), llvm::FunctionType::isVarArg(), llvm::Type::isVoidTy(), llvm_unreachable, llvm::Type::PointerTyID, llvm::Type::PPC_FP128TyID, llvm::PTOGV(), llvm::RetTy, llvm::Type::VoidTyID, and llvm::Type::X86_FP80TyID.