llvm::ExecutionEngine

Abstract interface for implementation execution of LLVM modules, designed to support both interpreter and just-in-time (JIT) compiler implementations.

Synopsis

Declared in <llvm/ExecutionEngine/ExecutionEngine.h>

class ExecutionEngine;

Member Functions

NameDescription
~ExecutionEngine [destructor] [virtual]Destroy the execution engine and release owned resources.
DisableGVCompilation Abort if asked to materialize a non-internal GlobalVariable.
DisableLazyCompilation Enable or disable lazy JIT compilation.
DisableSymbolSearching Disable looking up unknown symbols with dlsym.
FindFunctionNamed [virtual]Search active modules for the function that defines FnName.
FindGlobalVariableNamed [virtual]Search active modules for the global variable that defines Name.
InitializeMemory Initialize memory at Addr from constant initializer Init.
InstallLazyFunctionCreator Install a callback used to materialize unknown functions.
RegisterJITEventListener [virtual]Register a listener for JIT compilation events.
StoreValueToMemory Store a GenericValue of type Ty into memory at Ptr.
UnregisterJITEventListener [virtual]Unregister a previously registered JIT event listener.
addArchive [virtual]Add an Archive to the execution engine.
addGlobalMapping addGlobalMapping overloads
addModule [virtual]Add a Module to the list of modules that we can JIT from.
addObjectFile addObjectFile overloads
clearAllGlobalMappings clearAllGlobalMappings - Clear all global mappings and start over again, for use in dynamic compilation scenarios to move globals.
clearErrorMessage Clear the error message.
clearGlobalMappingsFromModule Clear all global mappings that came from a particular module.
finalizeObject [virtual]finalizeObject - ensure the module is fully processed and is usable.
generateCodeForModule [virtual]Run code generation for the specified module and load it into memory.
getAddressToGlobalIfAvailable Return the address of the specified global symbol if available.
getDataLayout Return the data layout used by this execution engine.
getErrorMessage Returns the most recent error message.
getFunctionAddress [virtual]Return the address of the specified function.
getGlobalValueAddress [virtual]Return the address of the specified global value.
getGlobalValueAtAddress Return the LLVM global value object that starts at the specified address.
getOrEmitGlobalVariable [virtual]Return the address of a global variable, emitting it if needed.
getPointerToFunction [virtual]Return a pointer to the machine code for function F.
getPointerToFunctionOrStub [virtual]Return a pointer to F, compiling or using a lazy stub if needed.
getPointerToGlobal Return the address of the specified global value.
getPointerToGlobalIfAvailable getPointerToGlobalIfAvailable overloads
getPointerToNamedFunction [virtual]Return the address of a named function via dlsym.
getTargetMachine [virtual]Return the target machine (if available).
getVerifyModules Return true if IR module verification is enabled.
hasError Returns true if an error has been recorded.
isCompilingLazily Return true if lazy JIT compilation is currently enabled.
isGVCompilationDisabled Return true if compiling external global variables is disabled.
isSymbolSearchingDisabled Return true if dlsym-based symbol searching is disabled.
mapSectionAddress [virtual]Map a JIT section's local address to its target address.
removeModule [virtual]Remove a module from the engine without freeing it.
runFunction [virtual]Execute the specified function with the specified arguments.
runFunctionAsMain Run Fn as a program entry point with argc, argv, and envp.
runStaticConstructorsDestructors runStaticConstructorsDestructors overloads
setObjectCache [virtual]Sets the pre-compiled object cache. The ownership of the ObjectCache is not changed. Supported by MCJIT but not the interpreter.
setProcessAllSections [virtual]Control whether MCJIT passes all object sections to the memory manager.
setVerifyModules Enable or disable IR module verification during compilation.
updateGlobalMapping updateGlobalMapping overloads

Data Members

NameDescription
lock lock - This lock protects the ExecutionEngine and MCJIT classes. It must be held while changing the internal state of any of those classes.

Protected Member Functions

NameDescription
ExecutionEngine [constructor]Constructors
LoadValueFromMemory Load a value of type Ty from Ptr into Result.
emitGlobalVariable Emit a single global variable into memory.
emitGlobals Emit all global variables from owned modules into memory.
getConstantValue Evaluate an LLVM constant as a GenericValue.
getMangledName Get the mangled name of a global value.
getMemoryForGV [virtual]Allocate memory for a global variable.

Protected Data Members

NameDescription
ErrMsg Most recent error message recorded by the execution engine.
LazyFunctionCreator LazyFunctionCreator - If an unknown function is needed, this function pointer is invoked to create it. If this returns null, the JIT will abort.
Modules The list of Modules that we are JIT'ing from. We use a SmallVector to optimize for the case where there is only one module.

Protected Static Data Members

NameDescription
InterpCtor Factory used by EngineBuilder to construct an interpreter engine.
MCJITCtor Factory used by EngineBuilder to construct an MCJIT execution engine.

Friends

NameDescription
llvm::EngineBuilderBuilder class for ExecutionEngines. Use this by stack-allocating a builder, chaining the various set* methods, and terminating it with a .create() call.

Non-Member Functions

NameDescription
unwrapConvert an opaque LLVMExecutionEngineRef to an ExecutionEngine pointer.
wrapConvert an ExecutionEngine pointer to an opaque LLVMExecutionEngineRef.