LLVM API Documentation
#include <ExecutionEngine.h>
Public Member Functions | |
| virtual | ~ExecutionEngine () |
| virtual void | addModuleProvider (ModuleProvider *P) |
| const TargetData * | getTargetData () const |
| virtual Module * | removeModuleProvider (ModuleProvider *P, std::string *ErrInfo=0) |
| virtual void | deleteModuleProvider (ModuleProvider *P, std::string *ErrInfo=0) |
| Function * | FindFunctionNamed (const char *FnName) |
| virtual GenericValue | runFunction (Function *F, const std::vector< GenericValue > &ArgValues)=0 |
| void | runStaticConstructorsDestructors (bool isDtors) |
| void | runStaticConstructorsDestructors (Module *module, bool isDtors) |
| int | runFunctionAsMain (Function *Fn, const std::vector< std::string > &argv, const char *const *envp) |
| void | addGlobalMapping (const GlobalValue *GV, void *Addr) |
| void | clearAllGlobalMappings () |
| void | clearGlobalMappingsFromModule (Module *M) |
| void * | updateGlobalMapping (const GlobalValue *GV, void *Addr) |
| void * | getPointerToGlobalIfAvailable (const GlobalValue *GV) |
| void * | getPointerToGlobal (const GlobalValue *GV) |
| virtual void * | getPointerToFunction (Function *F)=0 |
| virtual void * | getPointerToFunctionOrStub (Function *F) |
| const GlobalValue * | getGlobalValueAtAddress (void *Addr) |
| void | StoreValueToMemory (const GenericValue &Val, GenericValue *Ptr, const Type *Ty) |
| void | InitializeMemory (const Constant *Init, void *Addr) |
| virtual void * | recompileAndRelinkFunction (Function *F)=0 |
| virtual void | freeMachineCodeForFunction (Function *F)=0 |
| virtual void * | getOrEmitGlobalVariable (const GlobalVariable *GV) |
| void | DisableLazyCompilation (bool Disabled=true) |
| bool | isLazyCompilationDisabled () const |
| void | DisableGVCompilation (bool Disabled=true) |
| bool | isGVCompilationDisabled () const |
| void | DisableSymbolSearching (bool Disabled=true) |
| bool | isSymbolSearchingDisabled () const |
| void | InstallLazyFunctionCreator (void *(*P)(const std::string &)) |
Static Public Member Functions | |
| static ExecutionEngine * | create (ModuleProvider *MP, bool ForceInterpreter=false, std::string *ErrorStr=0, bool Fast=false) |
| static ExecutionEngine * | create (Module *M) |
| static ExecutionEngine * | createJIT (ModuleProvider *MP, std::string *ErrorStr=0, JITMemoryManager *JMM=0, bool Fast=false) |
| static void | InstallExceptionTableRegister (void(*F)(void *)) |
| static void | RegisterTable (void *res) |
Public Attributes | |
| sys::Mutex | lock |
Protected Types | |
| typedef ExecutionEngine *(* | EECtorFn )(ModuleProvider *, std::string *, bool Fast) |
| typedef void(* | EERegisterFn )(void *) |
Protected Member Functions | |
| void | setTargetData (const TargetData *td) |
| virtual char * | getMemoryForGV (const GlobalVariable *GV) |
| getMemoryforGV - Allocate memory for a global variable. | |
| ExecutionEngine (ModuleProvider *P) | |
| void | emitGlobals () |
| void | EmitGlobalVariable (const GlobalVariable *GV) |
| GenericValue | getConstantValue (const Constant *C) |
| Get a GenericValue for a Constant*. | |
| void | LoadValueFromMemory (GenericValue &Result, GenericValue *Ptr, const Type *Ty) |
Protected Attributes | |
| SmallVector< ModuleProvider *, 1 > | Modules |
| void *(* | LazyFunctionCreator )(const std::string &) |
Static Protected Attributes | |
| static EECtorFn | JITCtor = 0 |
| static EECtorFn | InterpCtor = 0 |
| static EERegisterFn | ExceptionTableRegister = 0 |
Definition at line 63 of file ExecutionEngine/ExecutionEngine.h.
typedef ExecutionEngine*(* llvm::ExecutionEngine::EECtorFn)(ModuleProvider *, std::string *, bool Fast) [protected] |
typedef void(* llvm::ExecutionEngine::EERegisterFn)(void *) [protected] |
| ExecutionEngine::~ExecutionEngine | ( | ) | [virtual] |
Definition at line 49 of file ExecutionEngine.cpp.
References clearAllGlobalMappings(), and Modules.
| ExecutionEngine::ExecutionEngine | ( | ModuleProvider * | P | ) | [explicit, protected] |
| void llvm::ExecutionEngine::setTargetData | ( | const TargetData * | td | ) | [inline, protected] |
Definition at line 75 of file ExecutionEngine/ExecutionEngine.h.
Referenced by llvm::Interpreter::Interpreter().
| char * ExecutionEngine::getMemoryForGV | ( | const GlobalVariable * | GV | ) | [protected, virtual] |
getMemoryforGV - Allocate memory for a global variable.
Reimplemented in llvm::JIT.
Definition at line 55 of file ExecutionEngine.cpp.
References llvm::SequentialType::getElementType(), getTargetData(), llvm::GlobalValue::getType(), and llvm::TargetData::getTypePaddedSize().
Referenced by emitGlobals(), and EmitGlobalVariable().
| ExecutionEngine * ExecutionEngine::create | ( | ModuleProvider * | MP, | |
| bool | ForceInterpreter = false, |
|||
| std::string * | ErrorStr = 0, |
|||
| bool | Fast = false | |||
| ) | [static] |
create - This is the factory method for creating an execution engine which is appropriate for the current machine. This takes ownership of the module provider.
If possible, create a JIT, unless the caller specifically requests an Interpreter or there's an error. If even an Interpreter cannot be created, NULL is returned.
Definition at line 382 of file ExecutionEngine.cpp.
References InterpCtor, JITCtor, and llvm::sys::DynamicLibrary::LoadLibraryPermanently().
Referenced by create().
| ExecutionEngine * ExecutionEngine::create | ( | Module * | M | ) | [static] |
create - This is the factory method for creating an execution engine which is appropriate for the current machine. This takes ownership of the module.
Definition at line 404 of file ExecutionEngine.cpp.
References create().
| ExecutionEngine * ExecutionEngine::createJIT | ( | ModuleProvider * | MP, | |
| std::string * | ErrorStr = 0, |
|||
| JITMemoryManager * | JMM = 0, |
|||
| bool | Fast = false | |||
| ) | [static] |
createJIT - This is the factory method for creating a JIT for the current machine, it does not fall back to the interpreter. This takes ownership of the ModuleProvider and JITMemoryManager if successful.
createJIT - This is the factory method for creating a JIT for the current machine, it does not fall back to the interpreter. This takes ownership of the module provider.
Reimplemented in llvm::JIT.
Definition at line 192 of file JIT.cpp.
References llvm::JIT::createJIT(), and llvm::sys::DynamicLibrary::LoadLibraryPermanently().
| virtual void llvm::ExecutionEngine::addModuleProvider | ( | ModuleProvider * | P | ) | [inline, virtual] |
addModuleProvider - Add a ModuleProvider to the list of modules that we can JIT from. Note that this takes ownership of the ModuleProvider: when the ExecutionEngine is destroyed, it destroys the MP as well.
Reimplemented in llvm::JIT.
Definition at line 136 of file ExecutionEngine/ExecutionEngine.h.
References Modules.
Referenced by llvm::JIT::addModuleProvider().
| const TargetData* llvm::ExecutionEngine::getTargetData | ( | ) | const [inline] |
Definition at line 142 of file ExecutionEngine/ExecutionEngine.h.
Referenced by CreateArgv(), EmitGlobalVariable(), GetConstantPoolSizeInBytes(), llvm::JIT::getMemoryForGV(), getMemoryForGV(), llvm::JIT::getOrEmitGlobalVariable(), InitializeMemory(), lle_X_sprintf(), LoadValueFromMemory(), and StoreValueToMemory().
| Module * ExecutionEngine::removeModuleProvider | ( | ModuleProvider * | P, | |
| std::string * | ErrInfo = 0 | |||
| ) | [virtual] |
removeModuleProvider - Remove a ModuleProvider from the list of modules. Relases the Module from the ModuleProvider, materializing it in the process, and returns the materialized Module.
removeModuleProvider - Remove a ModuleProvider from the list of modules. Relases the Module from the ModuleProvider, materializing it in the process, and returns the materialized Module.
Reimplemented in llvm::JIT.
Definition at line 64 of file ExecutionEngine.cpp.
References clearGlobalMappingsFromModule(), E, llvm::ModuleProvider::getModule(), Modules, and llvm::ModuleProvider::releaseModule().
Referenced by llvm::JIT::removeModuleProvider().
| void ExecutionEngine::deleteModuleProvider | ( | ModuleProvider * | P, | |
| std::string * | ErrInfo = 0 | |||
| ) | [virtual] |
deleteModuleProvider - Remove a ModuleProvider from the list of modules, and deletes the ModuleProvider and owned Module. Avoids materializing the underlying module.
deleteModuleProvider - Remove a ModuleProvider from the list of modules, and deletes the ModuleProvider and owned Module. Avoids materializing the underlying module.
Reimplemented in llvm::JIT.
Definition at line 81 of file ExecutionEngine.cpp.
References clearGlobalMappingsFromModule(), E, llvm::ModuleProvider::getModule(), and Modules.
Referenced by llvm::JIT::deleteModuleProvider().
| Function * ExecutionEngine::FindFunctionNamed | ( | const char * | FnName | ) |
FindFunctionNamed - Search all of the active modules to find the one that defines FnName. This is very slow operation and shouldn't be used for general code.
FindFunctionNamed - Search all of the active modules to find the one that defines FnName. This is very slow operation and shouldn't be used for general code.
Definition at line 98 of file ExecutionEngine.cpp.
Referenced by getPointerToNamedFunction().
| virtual GenericValue llvm::ExecutionEngine::runFunction | ( | Function * | F, | |
| const std::vector< GenericValue > & | ArgValues | |||
| ) | [pure virtual] |
runFunction - Execute the specified function with the specified arguments, and return the result.
Implemented in llvm::Interpreter, and llvm::JIT.
Referenced by runFunctionAsMain(), and runStaticConstructorsDestructors().
| void ExecutionEngine::runStaticConstructorsDestructors | ( | bool | isDtors | ) |
runStaticConstructorsDestructors - This method is used to execute all of the static constructors or destructors for a program, depending on the value of isDtors.
runStaticConstructorsDestructors - This method is used to execute all of the static constructors or destructors for a program, depending on the value of isDtors.
Definition at line 298 of file ExecutionEngine.cpp.
References Modules.
| void ExecutionEngine::runStaticConstructorsDestructors | ( | Module * | module, | |
| bool | isDtors | |||
| ) |
runStaticConstructorsDestructors - This method is used to execute all of the static constructors or destructors for a module, depending on the value of isDtors.
runStaticConstructorsDestructors - This method is used to execute all of the static constructors or destructors for a module, depending on the value of isDtors.
Definition at line 259 of file ExecutionEngine.cpp.
References llvm::dyn_cast(), F, llvm::GlobalVariable::getInitializer(), llvm::Module::getNamedGlobal(), llvm::User::getNumOperands(), llvm::Constant::getOperand(), GV, llvm::GlobalValue::hasLocalLinkage(), llvm::GlobalVariable::isDeclaration(), llvm::Constant::isNullValue(), Name, and runFunction().
| int ExecutionEngine::runFunctionAsMain | ( | Function * | Fn, | |
| const std::vector< std::string > & | argv, | |||
| const char *const * | envp | |||
| ) |
runFunctionAsMain - This is a helper function which wraps runFunction to handle the common task of starting up main with the specified argc, argv, and envp parameters.
runFunctionAsMain - This is a helper function which wraps runFunction to handle the common task of starting up main with the specified argc, argv, and envp parameters.
Definition at line 318 of file ExecutionEngine.cpp.
References llvm::cerr(), CreateArgv(), llvm::Function::getFunctionType(), llvm::FunctionType::getNumParams(), llvm::FunctionType::getParamType(), llvm::FunctionType::getReturnType(), llvm::PointerType::getUnqual(), llvm::APInt::getZExtValue(), llvm::GVTOP(), llvm::Type::Int32Ty, llvm::Type::Int8Ty, llvm::GenericValue::IntVal, isTargetNullPtr(), llvm::PTOGV(), runFunction(), and llvm::Type::VoidTy.
| void ExecutionEngine::addGlobalMapping | ( | const GlobalValue * | GV, | |
| void * | Addr | |||
| ) |
addGlobalMapping - Tell the execution engine that the specified global is at the specified location. This is used internally as functions are JIT'd and as global variables are laid out in memory. It can and should also be used by clients of the EE that want to have an LLVM global overlay existing data in memory.
addGlobalMapping - Tell the execution engine that the specified global is at the specified location. This is used internally as functions are JIT'd and as global variables are laid out in memory. It can and should also be used by clients of the EE that want to have an LLVM global overlay existing data in memory.
Definition at line 112 of file ExecutionEngine.cpp.
References DOUT, llvm::Value::getNameStart(), lock, state, and V.
Referenced by emitGlobals(), EmitGlobalVariable(), llvm::JIT::getOrEmitGlobalVariable(), llvm::JIT::getPointerToFunction(), and llvm::JIT::recompileAndRelinkFunction().
| void ExecutionEngine::clearAllGlobalMappings | ( | ) |
clearAllGlobalMappings - Clear all global mappings and start over again use in dynamic compilation scenarios when you want to move globals
clearAllGlobalMappings - Clear all global mappings and start over again use in dynamic compilation scenarios when you want to move globals
Definition at line 130 of file ExecutionEngine.cpp.
Referenced by ~ExecutionEngine().
| void ExecutionEngine::clearGlobalMappingsFromModule | ( | Module * | M | ) |
clearGlobalMappingsFromModule - Clear all global mappings that came from a particular module, because it has been removed from the JIT.
clearGlobalMappingsFromModule - Clear all global mappings that came from a particular module, because it has been removed from the JIT.
Definition at line 139 of file ExecutionEngine.cpp.
References llvm::Module::begin(), llvm::Module::end(), FI, GE, llvm::Module::global_begin(), llvm::Module::global_end(), lock, and state.
Referenced by deleteModuleProvider(), and removeModuleProvider().
| void * ExecutionEngine::updateGlobalMapping | ( | const GlobalValue * | GV, | |
| void * | Addr | |||
| ) |
updateGlobalMapping - Replace an existing mapping for GV with a new address. This updates both maps as required. If "Addr" is null, the entry for the global is removed from the mappings. This returns the old value of the pointer, or null if it was not in the map.
updateGlobalMapping - Replace an existing mapping for GV with a new address. This updates both maps as required. If "Addr" is null, the entry for the global is removed from the mappings.
Definition at line 156 of file ExecutionEngine.cpp.
References lock, state, and V.
Referenced by llvm::JIT::freeMachineCodeForFunction().
| void * ExecutionEngine::getPointerToGlobalIfAvailable | ( | const GlobalValue * | GV | ) |
getPointerToGlobalIfAvailable - This returns the address of the specified global value if it is has already been codegen'd, otherwise it returns null.
getPointerToGlobalIfAvailable - This returns the address of the specified global value if it is has already been codegen'd, otherwise it returns null.
Definition at line 196 of file ExecutionEngine.cpp.
Referenced by emitGlobals(), EmitGlobalVariable(), llvm::JIT::getOrEmitGlobalVariable(), llvm::JIT::getPointerToFunction(), llvm::JIT::getPointerToFunctionOrStub(), and llvm::JIT::recompileAndRelinkFunction().
| void * ExecutionEngine::getPointerToGlobal | ( | const GlobalValue * | GV | ) |
getPointerToGlobal - This returns the address of the specified global value. This may involve code generation if it's a function.
getPointerToGlobal - This returns the address of the specified global value. This may involve code generation if it's a function.
Definition at line 411 of file ExecutionEngine.cpp.
References EmitGlobalVariable(), F, getPointerToFunction(), lock, and state.
Referenced by getOrEmitGlobalVariable().
| virtual void* llvm::ExecutionEngine::getPointerToFunction | ( | Function * | F | ) | [pure 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.
Implemented in llvm::JIT.
Referenced by getPointerToFunctionOrStub(), and getPointerToGlobal().
| virtual void* llvm::ExecutionEngine::getPointerToFunctionOrStub | ( | Function * | F | ) | [inline, 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 in llvm::JIT.
Definition at line 226 of file ExecutionEngine/ExecutionEngine.h.
References getPointerToFunction().
Referenced by getConstantValue().
| const GlobalValue * ExecutionEngine::getGlobalValueAtAddress | ( | void * | Addr | ) |
getGlobalValueAtAddress - Return the LLVM global value object that starts at the specified address.
getGlobalValueAtAddress - Return the LLVM global value object that starts at the specified address.
Definition at line 207 of file ExecutionEngine.cpp.
| void ExecutionEngine::StoreValueToMemory | ( | const GenericValue & | Val, | |
| GenericValue * | Ptr, | |||
| const Type * | Ty | |||
| ) |
StoreValueToMemory - Stores the data in Val of type Ty at address Ptr. Ptr is the address of the memory at which to store Val, cast to GenericValue *. It is not a pointer to a GenericValue containing the address at which to store Val.
Definition at line 736 of file ExecutionEngine.cpp.
References llvm::cerr(), Dest, llvm::Type::DoubleTyID, llvm::GenericValue::DoubleVal, llvm::Type::FloatTyID, llvm::GenericValue::FloatVal, llvm::APInt::getRawData(), getTargetData(), llvm::Type::getTypeID(), llvm::TargetData::getTypeStoreSize(), llvm::Type::IntegerTyID, llvm::GenericValue::IntVal, llvm::TargetData::isLittleEndian(), llvm::sys::isLittleEndianHost(), llvm::Intrinsic::memset, llvm::Type::PointerTyID, llvm::GenericValue::PointerVal, Src, StoreIntToMemory(), and llvm::Type::X86_FP80TyID.
Referenced by ByteswapSCANFResults(), CreateArgv(), InitializeMemory(), and llvm::Interpreter::visitStoreInst().
| void ExecutionEngine::InitializeMemory | ( | const Constant * | Init, | |
| void * | Addr | |||
| ) |
Definition at line 859 of file ExecutionEngine.cpp.
References llvm::cerr(), CP, DEBUG, DOUT, llvm::Value::dump(), getConstantValue(), llvm::StructLayout::getElementOffset(), llvm::User::getNumOperands(), llvm::Constant::getOperand(), llvm::TargetData::getStructLayout(), getTargetData(), llvm::Value::getType(), llvm::TargetData::getTypePaddedSize(), llvm::Type::isFirstClassType(), llvm::Intrinsic::memset, StoreValueToMemory(), and Val.
Referenced by EmitGlobalVariable().
| virtual void* llvm::ExecutionEngine::recompileAndRelinkFunction | ( | Function * | F | ) | [pure 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().
Implemented in llvm::Interpreter, and llvm::JIT.
| virtual void llvm::ExecutionEngine::freeMachineCodeForFunction | ( | Function * | F | ) | [pure virtual] |
freeMachineCodeForFunction - Release memory in the ExecutionEngine corresponding to the machine code emitted to execute this function, useful for garbage-collecting generated code.
Implemented in llvm::Interpreter, and llvm::JIT.
| virtual void* llvm::ExecutionEngine::getOrEmitGlobalVariable | ( | const GlobalVariable * | GV | ) | [inline, virtual] |
getOrEmitGlobalVariable - Return the address of the specified global variable, possibly emitting it to memory if needed. This is used by the Emitter.
Reimplemented in llvm::JIT.
Definition at line 258 of file ExecutionEngine/ExecutionEngine.h.
References getPointerToGlobal().
Referenced by getConstantValue().
| void llvm::ExecutionEngine::DisableLazyCompilation | ( | bool | Disabled = true |
) | [inline] |
DisableLazyCompilation - If called, the JIT will abort if lazy compilation is ever attempted.
Definition at line 264 of file ExecutionEngine/ExecutionEngine.h.
| bool llvm::ExecutionEngine::isLazyCompilationDisabled | ( | ) | const [inline] |
Definition at line 267 of file ExecutionEngine/ExecutionEngine.h.
| void llvm::ExecutionEngine::DisableGVCompilation | ( | bool | Disabled = true |
) | [inline] |
DisableGVCompilation - If called, the JIT will abort if it's asked to allocate space and populate a GlobalVariable that is not internal to the module.
Definition at line 274 of file ExecutionEngine/ExecutionEngine.h.
| bool llvm::ExecutionEngine::isGVCompilationDisabled | ( | ) | const [inline] |
Definition at line 277 of file ExecutionEngine/ExecutionEngine.h.
Referenced by llvm::JIT::getOrEmitGlobalVariable().
| void llvm::ExecutionEngine::DisableSymbolSearching | ( | bool | Disabled = true |
) | [inline] |
DisableSymbolSearching - If called, the JIT will not try to lookup unknown symbols with dlsym. A client can still use InstallLazyFunctionCreator to resolve symbols in a custom way.
Definition at line 284 of file ExecutionEngine/ExecutionEngine.h.
| bool llvm::ExecutionEngine::isSymbolSearchingDisabled | ( | ) | const [inline] |
Definition at line 287 of file ExecutionEngine/ExecutionEngine.h.
Referenced by llvm::JIT::getPointerToNamedFunction().
| void llvm::ExecutionEngine::InstallLazyFunctionCreator | ( | void *(*)(const std::string &) | P | ) | [inline] |
InstallLazyFunctionCreator - If an unknown function is needed, the specified function pointer is invoked to create it. If it returns null, the JIT will abort.
Definition at line 295 of file ExecutionEngine/ExecutionEngine.h.
References LazyFunctionCreator.
| static void llvm::ExecutionEngine::InstallExceptionTableRegister | ( | void(*)(void *) | F | ) | [inline, static] |
InstallExceptionTableRegister - The JIT will use the given function to register the exception tables it generates.
Definition at line 301 of file ExecutionEngine/ExecutionEngine.h.
References ExceptionTableRegister, and F.
| static void llvm::ExecutionEngine::RegisterTable | ( | void * | res | ) | [inline, static] |
RegisterTable - Registers the given pointer as an exception table. It uses the ExceptionTableRegister function.
Definition at line 307 of file ExecutionEngine/ExecutionEngine.h.
References ExceptionTableRegister.
| void ExecutionEngine::emitGlobals | ( | ) | [protected] |
EmitGlobals - Emit all of the global variables to memory, storing their addresses into GlobalAddress. This must make sure to copy the contents of their initializers into the memory.
Definition at line 899 of file ExecutionEngine.cpp.
References addGlobalMapping(), llvm::cerr(), E, EmitGlobalVariable(), getMemoryForGV(), llvm::Value::getName(), getPointerToGlobalIfAvailable(), llvm::GlobalValue::getType(), llvm::Module::global_begin(), llvm::Module::global_end(), GV, llvm::GlobalValue::hasAppendingLinkage(), llvm::GlobalValue::hasDLLExportLinkage(), llvm::GlobalValue::hasDLLImportLinkage(), llvm::GlobalValue::hasExternalLinkage(), llvm::GlobalValue::hasExternalWeakLinkage(), llvm::GlobalValue::hasLocalLinkage(), llvm::Value::hasName(), llvm::GlobalValue::isDeclaration(), M, Modules, and llvm::sys::DynamicLibrary::SearchForAddressOfSymbol().
Referenced by llvm::Interpreter::Interpreter().
| void ExecutionEngine::EmitGlobalVariable | ( | const GlobalVariable * | GV | ) | [protected] |
Definition at line 1008 of file ExecutionEngine.cpp.
References addGlobalMapping(), llvm::SequentialType::getElementType(), llvm::GlobalVariable::getInitializer(), getMemoryForGV(), getPointerToGlobalIfAvailable(), getTargetData(), llvm::GlobalValue::getType(), llvm::TargetData::getTypePaddedSize(), InitializeMemory(), and llvm::GlobalVariable::isThreadLocal().
Referenced by emitGlobals(), llvm::JIT::getOrEmitGlobalVariable(), and getPointerToGlobal().
| GenericValue ExecutionEngine::getConstantValue | ( | const Constant * | C | ) | [protected] |
Get a GenericValue for a Constant*.
This function converts a Constant* into a GenericValue. The interesting part is if C is a ConstantExpr.
Definition at line 432 of file ExecutionEngine.cpp.
References llvm::APFloat::add(), Add(), And(), llvm::lltok::APFloat, BitCast, llvm::APFloat::bitcastToAPInt(), llvm::APInt::bitsToDouble(), llvm::APInt::bitsToFloat(), llvm::cerr(), llvm::APFloat::convertFromAPInt(), llvm::APFloat::convertToInteger(), llvm::APFloat::divide(), llvm::APInt::doubleToBits(), llvm::Type::DoubleTy, llvm::Type::DoubleTyID, llvm::GenericValue::DoubleVal, F, llvm::APInt::floatToBits(), llvm::Type::FloatTy, llvm::Type::FloatTyID, llvm::GenericValue::FloatVal, llvm::Type::FP128TyID, FPToUI, FPTrunc, llvm::APInt::getBitWidth(), llvm::TargetData::getIndexedOffset(), getOrEmitGlobalVariable(), llvm::TargetData::getPointerSizeInBits(), getPointerToFunctionOrStub(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::APInt::getZExtValue(), GV, Indices, llvm::Type::Int32Ty, llvm::Type::Int64Ty, llvm::Type::IntegerTyID, llvm::GenericValue::IntVal, llvm::Type::isFloatingPoint(), LHS, llvm::APFloat::mod(), llvm::APFloat::multiply(), Offset, llvm::APIntOps::Or(), llvm::Type::PointerTyID, llvm::GenericValue::PointerVal, llvm::Type::PPC_FP128TyID, llvm::PTOGV(), PtrToInt, RHS, llvm::APFloat::rmNearestTiesToEven, llvm::APFloat::rmTowardZero, llvm::APIntOps::RoundDoubleToAPInt(), llvm::APIntOps::RoundFloatToAPInt(), llvm::APInt::roundToDouble(), llvm::APInt::sdiv(), llvm::APInt::sext(), llvm::Attribute::SExt, llvm::APInt::signedRoundToDouble(), llvm::SmallVectorImpl< T >::size(), llvm::APInt::srem(), llvm::APFloat::subtract(), TD, llvm::APInt::trunc(), llvm::APInt::udiv(), UIToFP, llvm::APInt::urem(), llvm::Type::X86_FP80Ty, llvm::Type::X86_FP80TyID, llvm::APIntOps::Xor(), llvm::APInt::zext(), ZExt, and llvm::APInt::zextOrTrunc().
Referenced by InitializeMemory().
| void ExecutionEngine::LoadValueFromMemory | ( | GenericValue & | Result, | |
| GenericValue * | Ptr, | |||
| const Type * | Ty | |||
| ) | [protected] |
FIXME: document
Definition at line 805 of file ExecutionEngine.cpp.
References llvm::cerr(), llvm::Type::DoubleTyID, llvm::GenericValue::DoubleVal, llvm::Type::FloatTyID, llvm::GenericValue::FloatVal, getTargetData(), llvm::Type::getTypeID(), llvm::TargetData::getTypeStoreSize(), llvm::Type::IntegerTyID, llvm::GenericValue::IntVal, llvm::sys::isLittleEndianHost(), LoadIntFromMemory(), llvm::Type::PointerTyID, llvm::GenericValue::PointerVal, Src, and llvm::Type::X86_FP80TyID.
Referenced by llvm::Interpreter::visitLoadInst().
SmallVector<ModuleProvider*, 1> llvm::ExecutionEngine::Modules [protected] |
Modules - This is a list of ModuleProvider's that we are JIT'ing from. We use a smallvector to optimize for the case where there is only one module.
Definition at line 73 of file ExecutionEngine/ExecutionEngine.h.
Referenced by llvm::JIT::addModuleProvider(), addModuleProvider(), llvm::JIT::deleteModuleProvider(), deleteModuleProvider(), emitGlobals(), ExecutionEngine(), FindFunctionNamed(), llvm::JIT::getPointerToFunction(), llvm::JIT::removeModuleProvider(), removeModuleProvider(), runStaticConstructorsDestructors(), and ~ExecutionEngine().
ExecutionEngine::EECtorFn ExecutionEngine::JITCtor = 0 [static, protected] |
Definition at line 87 of file ExecutionEngine/ExecutionEngine.h.
Referenced by create(), and llvm::JIT::Register().
ExecutionEngine::EECtorFn ExecutionEngine::InterpCtor = 0 [static, protected] |
Definition at line 87 of file ExecutionEngine/ExecutionEngine.h.
Referenced by create(), and llvm::Interpreter::Register().
void*(* llvm::ExecutionEngine::LazyFunctionCreator)(const std::string &) [protected] |
LazyFunctionCreator - If an unknown function is needed, this function pointer is invoked to create it. If this returns null, the JIT will abort.
Referenced by llvm::JIT::getPointerToNamedFunction(), and InstallLazyFunctionCreator().
ExecutionEngine::EERegisterFn ExecutionEngine::ExceptionTableRegister = 0 [static, protected] |
Definition at line 96 of file ExecutionEngine/ExecutionEngine.h.
Referenced by InstallExceptionTableRegister(), and RegisterTable().
lock - This lock is protects the ExecutionEngine, JIT, JITResolver and JITEmitter classes. It must be held while changing the internal state of any of those classes.
Definition at line 102 of file ExecutionEngine/ExecutionEngine.h.
Referenced by addGlobalMapping(), llvm::JIT::addModuleProvider(), clearAllGlobalMappings(), clearGlobalMappingsFromModule(), llvm::JIT::deleteModuleProvider(), getGlobalValueAtAddress(), llvm::JIT::getMemoryForGV(), llvm::JIT::getOrEmitGlobalVariable(), llvm::JIT::getPointerToFunction(), getPointerToGlobal(), getPointerToGlobalIfAvailable(), llvm::JIT::removeModuleProvider(), and updateGlobalMapping().