LLVM 20.0.0git
|
#include "ExecutionEngine/MCJIT/MCJIT.h"
Public Member Functions | |
~MCJIT () override | |
ExecutionEngine interface implementation | |
void | addModule (std::unique_ptr< Module > M) override |
Add a Module to the list of modules that we can JIT from. | |
void | addObjectFile (std::unique_ptr< object::ObjectFile > O) override |
addObjectFile - Add an ObjectFile to the execution engine. | |
void | addObjectFile (object::OwningBinary< object::ObjectFile > O) override |
void | addArchive (object::OwningBinary< object::Archive > O) override |
addArchive - Add an Archive to the execution engine. | |
bool | removeModule (Module *M) override |
removeModule - Removes a Module from the list of modules, but does not free the module's memory. | |
Function * | FindFunctionNamed (StringRef FnName) override |
FindFunctionNamed - Search all of the active modules to find the function that defines FnName. | |
GlobalVariable * | FindGlobalVariableNamed (StringRef Name, bool AllowInternal=false) override |
FindGlobalVariableNamed - Search all of the active modules to find the global variable that defines Name. | |
void | setObjectCache (ObjectCache *manager) override |
Sets the object manager that MCJIT should use to avoid compilation. | |
void | setProcessAllSections (bool ProcessAllSections) override |
setProcessAllSections (MCJIT Only): By default, only sections that are "required for execution" are passed to the RTDyldMemoryManager, and other sections are discarded. | |
void | generateCodeForModule (Module *M) override |
generateCodeForModule - Run code generation for the specified module and load it into memory. | |
void | finalizeObject () override |
finalizeObject - ensure the module is fully processed and is usable. | |
virtual void | finalizeModule (Module *) |
void | finalizeLoadedModules () |
void | runStaticConstructorsDestructors (bool isDtors) override |
runStaticConstructorsDestructors - This method is used to execute all of the static constructors or destructors for a program. | |
void * | getPointerToFunction (Function *F) override |
getPointerToFunction - The different EE's represent function bodies in different ways. | |
GenericValue | runFunction (Function *F, ArrayRef< GenericValue > ArgValues) override |
runFunction - Execute the specified function with the specified arguments, and return the result. | |
void * | getPointerToNamedFunction (StringRef Name, bool AbortOnFailure=true) override |
getPointerToNamedFunction - This method returns the address of the specified function by using the dlsym function call. | |
void | mapSectionAddress (const void *LocalAddress, uint64_t TargetAddress) override |
mapSectionAddress - map a section to its target address space value. | |
void | RegisterJITEventListener (JITEventListener *L) override |
Registers a listener to be called back on various events within the JIT. | |
void | UnregisterJITEventListener (JITEventListener *L) override |
uint64_t | getGlobalValueAddress (const std::string &Name) override |
getGlobalValueAddress - Return the address of the specified global value. | |
uint64_t | getFunctionAddress (const std::string &Name) override |
getFunctionAddress - Return the address of the specified function. | |
TargetMachine * | getTargetMachine () override |
Return the target machine (if available). | |
Public Member Functions inherited from llvm::ExecutionEngine | |
virtual | ~ExecutionEngine () |
virtual void | addModule (std::unique_ptr< Module > M) |
Add a Module to the list of modules that we can JIT from. | |
virtual void | addObjectFile (std::unique_ptr< object::ObjectFile > O) |
addObjectFile - Add an ObjectFile to the execution engine. | |
virtual void | addObjectFile (object::OwningBinary< object::ObjectFile > O) |
virtual void | addArchive (object::OwningBinary< object::Archive > A) |
addArchive - Add an Archive to the execution engine. | |
const DataLayout & | getDataLayout () const |
virtual bool | removeModule (Module *M) |
removeModule - Removes a Module from the list of modules, but does not free the module's memory. | |
virtual Function * | FindFunctionNamed (StringRef FnName) |
FindFunctionNamed - Search all of the active modules to find the function that defines FnName. | |
virtual GlobalVariable * | FindGlobalVariableNamed (StringRef Name, bool AllowInternal=false) |
FindGlobalVariableNamed - Search all of the active modules to find the global variable that defines Name. | |
virtual GenericValue | runFunction (Function *F, ArrayRef< GenericValue > ArgValues)=0 |
runFunction - Execute the specified function with the specified arguments, and return the result. | |
virtual void * | getPointerToNamedFunction (StringRef Name, bool AbortOnFailure=true)=0 |
getPointerToNamedFunction - This method returns the address of the specified function by using the dlsym function call. | |
virtual void | mapSectionAddress (const void *LocalAddress, uint64_t TargetAddress) |
mapSectionAddress - map a section to its target address space value. | |
virtual void | generateCodeForModule (Module *M) |
generateCodeForModule - Run code generation for the specified module and load it into memory. | |
virtual void | finalizeObject () |
finalizeObject - ensure the module is fully processed and is usable. | |
bool | hasError () const |
Returns true if an error has been recorded. | |
void | clearErrorMessage () |
Clear the error message. | |
const std::string & | getErrorMessage () const |
Returns the most recent error message. | |
virtual void | runStaticConstructorsDestructors (bool isDtors) |
runStaticConstructorsDestructors - This method is used to execute all of the static constructors or destructors for a program. | |
void | runStaticConstructorsDestructors (Module &module, bool isDtors) |
This method is used to execute all of the static constructors or destructors for a particular module. | |
int | 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. | |
void | addGlobalMapping (const GlobalValue *GV, void *Addr) |
addGlobalMapping - Tell the execution engine that the specified global is at the specified location. | |
void | addGlobalMapping (StringRef Name, uint64_t Addr) |
void | clearAllGlobalMappings () |
clearAllGlobalMappings - Clear all global mappings and start over again, for use in dynamic compilation scenarios to move globals. | |
void | clearGlobalMappingsFromModule (Module *M) |
clearGlobalMappingsFromModule - Clear all global mappings that came from a particular module, because it has been removed from the JIT. | |
uint64_t | updateGlobalMapping (const GlobalValue *GV, void *Addr) |
updateGlobalMapping - Replace an existing mapping for GV with a new address. | |
uint64_t | updateGlobalMapping (StringRef Name, uint64_t Addr) |
uint64_t | getAddressToGlobalIfAvailable (StringRef S) |
getAddressToGlobalIfAvailable - This returns the address of the specified global symbol. | |
void * | getPointerToGlobalIfAvailable (StringRef S) |
getPointerToGlobalIfAvailable - This returns the address of the specified global value if it is has already been codegen'd, otherwise it returns null. | |
void * | getPointerToGlobalIfAvailable (const GlobalValue *GV) |
void * | getPointerToGlobal (const GlobalValue *GV) |
getPointerToGlobal - This returns the address of the specified global value. | |
virtual void * | getPointerToFunction (Function *F)=0 |
getPointerToFunction - The different EE's represent function bodies in different ways. | |
virtual void * | getPointerToFunctionOrStub (Function *F) |
getPointerToFunctionOrStub - If the specified function has been code-gen'd, return a pointer to the function. | |
virtual uint64_t | getGlobalValueAddress (const std::string &Name) |
getGlobalValueAddress - Return the address of the specified global value. | |
virtual uint64_t | getFunctionAddress (const std::string &Name) |
getFunctionAddress - Return the address of the specified function. | |
const GlobalValue * | getGlobalValueAtAddress (void *Addr) |
getGlobalValueAtAddress - Return the LLVM global value object that starts at the specified address. | |
void | StoreValueToMemory (const GenericValue &Val, GenericValue *Ptr, Type *Ty) |
StoreValueToMemory - Stores the data in Val of type Ty at address Ptr. | |
void | InitializeMemory (const Constant *Init, void *Addr) |
virtual void * | getOrEmitGlobalVariable (const GlobalVariable *GV) |
getOrEmitGlobalVariable - Return the address of the specified global variable, possibly emitting it to memory if needed. | |
virtual void | RegisterJITEventListener (JITEventListener *) |
Registers a listener to be called back on various events within the JIT. | |
virtual void | UnregisterJITEventListener (JITEventListener *) |
virtual void | setObjectCache (ObjectCache *) |
Sets the pre-compiled object cache. | |
virtual void | setProcessAllSections (bool ProcessAllSections) |
setProcessAllSections (MCJIT Only): By default, only sections that are "required for execution" are passed to the RTDyldMemoryManager, and other sections are discarded. | |
virtual TargetMachine * | getTargetMachine () |
Return the target machine (if available). | |
void | DisableLazyCompilation (bool Disabled=true) |
DisableLazyCompilation - When lazy compilation is off (the default), the JIT will eagerly compile every function reachable from the argument to getPointerToFunction. | |
bool | isCompilingLazily () const |
void | DisableGVCompilation (bool Disabled=true) |
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. | |
bool | isGVCompilationDisabled () const |
void | DisableSymbolSearching (bool Disabled=true) |
DisableSymbolSearching - If called, the JIT will not try to lookup unknown symbols with dlsym. | |
bool | isSymbolSearchingDisabled () const |
void | setVerifyModules (bool Verify) |
Enable/Disable IR module verification. | |
bool | getVerifyModules () const |
void | InstallLazyFunctionCreator (FunctionCreator C) |
InstallLazyFunctionCreator - If an unknown function is needed, the specified function pointer is invoked to create it. | |
(Private) Registration Interfaces | |
JITSymbol | findSymbol (const std::string &Name, bool CheckFunctionsOnly) |
uint64_t | getSymbolAddress (const std::string &Name, bool CheckFunctionsOnly) |
static void | Register () |
static ExecutionEngine * | createJIT (std::unique_ptr< Module > M, std::string *ErrorStr, std::shared_ptr< MCJITMemoryManager > MemMgr, std::shared_ptr< LegacyJITSymbolResolver > Resolver, std::unique_ptr< TargetMachine > TM) |
std::unique_ptr< MemoryBuffer > | emitObject (Module *M) |
emitObject – Generate a JITed object in memory from the specified module Currently, MCJIT only supports a single module and the module passed to this function call is expected to be the contained module. | |
void | notifyObjectLoaded (const object::ObjectFile &Obj, const RuntimeDyld::LoadedObjectInfo &L) |
void | notifyFreeingObject (const object::ObjectFile &Obj) |
JITSymbol | findExistingSymbol (const std::string &Name) |
Module * | findModuleForSymbol (const std::string &Name, bool CheckFunctionsOnly) |
Additional Inherited Members | |
Public Attributes inherited from llvm::ExecutionEngine | |
sys::Mutex | lock |
lock - This lock protects the ExecutionEngine and MCJIT classes. | |
Protected Member Functions inherited from llvm::ExecutionEngine | |
virtual char * | getMemoryForGV (const GlobalVariable *GV) |
getMemoryforGV - Allocate memory for a global variable. | |
std::string | getMangledName (const GlobalValue *GV) |
getMangledName - Get mangled name. | |
ExecutionEngine (DataLayout DL) | |
ExecutionEngine (DataLayout DL, std::unique_ptr< Module > M) | |
ExecutionEngine (std::unique_ptr< Module > M) | |
void | emitGlobals () |
EmitGlobals - Emit all of the global variables to memory, storing their addresses into GlobalAddress. | |
void | emitGlobalVariable (const GlobalVariable *GV) |
GenericValue | getConstantValue (const Constant *C) |
Converts a Constant* into a GenericValue, including handling of ConstantExpr values. | |
void | LoadValueFromMemory (GenericValue &Result, GenericValue *Ptr, Type *Ty) |
FIXME: document. | |
Protected Attributes inherited from llvm::ExecutionEngine | |
SmallVector< std::unique_ptr< Module >, 1 > | Modules |
The list of Modules that we are JIT'ing from. | |
FunctionCreator | LazyFunctionCreator |
LazyFunctionCreator - If an unknown function is needed, this function pointer is invoked to create it. | |
std::string | ErrMsg |
Static Protected Attributes inherited from llvm::ExecutionEngine | |
static ExecutionEngine *(* | MCJITCtor )(std::unique_ptr< Module > M, std::string *ErrorStr, std::shared_ptr< MCJITMemoryManager > MM, std::shared_ptr< LegacyJITSymbolResolver > SR, std::unique_ptr< TargetMachine > TM) = nullptr |
static ExecutionEngine *(* | InterpCtor )(std::unique_ptr< Module > M, std::string *ErrorStr) =nullptr |
|
override |
Definition at line 93 of file MCJIT.cpp.
References llvm::RuntimeDyld::deregisterEHFrames(), llvm::ExecutionEngine::lock, and notifyFreeingObject().
|
overridevirtual |
addArchive - Add an Archive to the execution engine.
This method is only supported by MCJIT. MCJIT will use the archive to resolve external symbols in objects it is loading. If a symbol is found in the Archive the contained object file will be extracted (in memory) and loaded for possible execution.
Reimplemented from llvm::ExecutionEngine.
Definition at line 137 of file MCJIT.cpp.
References A.
|
overridevirtual |
Add a Module to the list of modules that we can JIT from.
Reimplemented from llvm::ExecutionEngine.
Definition at line 105 of file MCJIT.cpp.
References llvm::ExecutionEngine::getDataLayout(), and llvm::ExecutionEngine::lock.
|
overridevirtual |
Reimplemented from llvm::ExecutionEngine.
Definition at line 129 of file MCJIT.cpp.
References addObjectFile(), and llvm::object::OwningBinary< T >::takeBinary().
|
overridevirtual |
addObjectFile - Add an ObjectFile to the execution engine.
This method is only supported by MCJIT. MCJIT will immediately load the object into memory and adds its symbols to the list used to resolve external symbols while preparing other objects for execution.
Objects added using this function will not be made executable until needed by another object.
MCJIT will take ownership of the ObjectFile.
Reimplemented from llvm::ExecutionEngine.
Definition at line 119 of file MCJIT.cpp.
References llvm::RuntimeDyld::getErrorString(), llvm::RuntimeDyld::hasError(), llvm::RuntimeDyld::loadObject(), notifyObjectLoaded(), and llvm::report_fatal_error().
Referenced by addObjectFile(), and findSymbol().
|
static |
Definition at line 45 of file MCJIT.cpp.
References llvm::sys::DynamicLibrary::LoadLibraryPermanently().
Referenced by Register().
|
protected |
emitObject – Generate a JITed object in memory from the specified module Currently, MCJIT only supports a single module and the module passed to this function call is expected to be the contained module.
The module is passed as a parameter here to prepare for multiple module support in the future.
Definition at line 146 of file MCJIT.cpp.
References assert(), llvm::cantFail(), llvm::ExecutionEngine::getVerifyModules(), llvm::ExecutionEngine::lock, llvm::ObjectCache::notifyObjectCompiled(), llvm::report_fatal_error(), and llvm::legacy::PassManager::run().
Referenced by generateCodeForModule().
void MCJIT::finalizeLoadedModules | ( | ) |
Definition at line 238 of file MCJIT.cpp.
References llvm::ExecutionEngine::ErrMsg, llvm::RuntimeDyld::getErrorString(), llvm::RuntimeDyld::hasError(), llvm::ExecutionEngine::lock, llvm::RuntimeDyld::registerEHFrames(), llvm::RuntimeDyld::resolveRelocations(), and llvm::StringRef::str().
Referenced by finalizeModule(), finalizeObject(), getFunctionAddress(), and getGlobalValueAddress().
|
virtual |
Definition at line 271 of file MCJIT.cpp.
References assert(), finalizeLoadedModules(), generateCodeForModule(), and llvm::ExecutionEngine::lock.
Referenced by runFunction().
|
overridevirtual |
finalizeObject - ensure the module is fully processed and is usable.
It is the user-level function for completing the process of making the object usable for execution. It should be called after sections within an object have been relocated using mapSectionAddress. When this method is called the MCJIT execution engine will reapply relocations for a loaded object. Is it OK to finalize a set of modules, add modules and finalize again.
Reimplemented from llvm::ExecutionEngine.
Definition at line 258 of file MCJIT.cpp.
References finalizeLoadedModules(), generateCodeForModule(), and llvm::ExecutionEngine::lock.
Definition at line 284 of file MCJIT.cpp.
References Addr, llvm::JITSymbolFlags::Exported, llvm::ExecutionEngine::getPointerToGlobalIfAvailable(), llvm::RuntimeDyld::getSymbol(), and Name.
Referenced by findSymbol().
FindFunctionNamed - Search all of the active modules to find the function that defines FnName.
This is very slow operation and shouldn't be used for general code.
Reimplemented from llvm::ExecutionEngine.
Definition at line 487 of file MCJIT.cpp.
References F.
|
overridevirtual |
FindGlobalVariableNamed - Search all of the active modules to find the global variable that defines Name.
This is very slow operation and shouldn't be used for general code.
Reimplemented from llvm::ExecutionEngine.
Definition at line 499 of file MCJIT.cpp.
References Name.
Definition at line 293 of file MCJIT.cpp.
References F, G, llvm::ExecutionEngine::getDataLayout(), I, llvm::ExecutionEngine::lock, Name, and llvm::StringRef::substr().
Referenced by findSymbol().
Definition at line 337 of file MCJIT.cpp.
References A, addObjectFile(), Addr, llvm::consumeError(), llvm::JITSymbolFlags::Exported, findExistingSymbol(), findModuleForSymbol(), generateCodeForModule(), llvm::Expected< T >::get(), llvm::ExecutionEngine::LazyFunctionCreator, llvm::ExecutionEngine::lock, Name, llvm::report_fatal_error(), Sym, and llvm::Expected< T >::takeError().
Referenced by llvm::LinkingSymbolResolver::findSymbol(), and getSymbolAddress().
|
overridevirtual |
generateCodeForModule - Run code generation for the specified module and load it into memory.
When this function has completed, all code and data for the specified module, and any module on which this module depends, will be generated and loaded into memory, but relocations will not yet have been applied and all memory will be readable and writable but not executable.
This function is primarily useful when generating code for an external target, allowing the client an opportunity to remap section addresses before relocations are applied. Clients that intend to execute code locally can use the getFunctionAddress call, which will generate code and apply final preparations all in one step.
This method has no effect for the interpreter.
Reimplemented from llvm::ExecutionEngine.
Definition at line 189 of file MCJIT.cpp.
References assert(), llvm::object::ObjectFile::createObjectFile(), emitObject(), llvm::Expected< T >::get(), llvm::ExecutionEngine::getDataLayout(), llvm::RuntimeDyld::getErrorString(), llvm::ObjectCache::getObject(), llvm::RuntimeDyld::hasError(), llvm::RuntimeDyld::loadObject(), llvm::ExecutionEngine::lock, llvm::logAllUnhandledErrors(), notifyObjectLoaded(), OS, llvm::report_fatal_error(), and llvm::Expected< T >::takeError().
Referenced by finalizeModule(), finalizeObject(), findSymbol(), and getPointerToFunction().
getFunctionAddress - Return the address of the specified function.
This may involve code generation.
Reimplemented from llvm::ExecutionEngine.
Definition at line 402 of file MCJIT.cpp.
References finalizeLoadedModules(), getSymbolAddress(), llvm::ExecutionEngine::lock, and Name.
getGlobalValueAddress - Return the address of the specified global value.
This may involve code generation.
This function should not be called with the interpreter engine.
Reimplemented from llvm::ExecutionEngine.
Definition at line 394 of file MCJIT.cpp.
References finalizeLoadedModules(), getSymbolAddress(), llvm::ExecutionEngine::lock, and Name.
|
overridevirtual |
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.
This function is deprecated for the MCJIT execution engine. Use getFunctionAddress instead.
Implements llvm::ExecutionEngine.
Definition at line 411 of file MCJIT.cpp.
References Addr, F, generateCodeForModule(), llvm::JITEvaluatedSymbol::getAddress(), getPointerToNamedFunction(), llvm::RuntimeDyld::getSymbol(), llvm::ExecutionEngine::lock, Name, and llvm::ExecutionEngine::updateGlobalMapping().
Referenced by runFunction().
|
overridevirtual |
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.
If a LazyFunctionCreator is installed, use it to get/create the function.
Implements llvm::ExecutionEngine.
Definition at line 614 of file MCJIT.cpp.
References llvm::ExecutionEngine::isSymbolSearchingDisabled(), llvm::ExecutionEngine::LazyFunctionCreator, Name, llvm::report_fatal_error(), and Sym.
Referenced by getPointerToFunction().
Definition at line 320 of file MCJIT.cpp.
References findSymbol(), llvm::ExecutionEngine::getDataLayout(), llvm::Mangler::getNameWithPrefix(), Name, llvm::report_fatal_error(), and Sym.
Referenced by getFunctionAddress(), and getGlobalValueAddress().
|
inlineoverridevirtual |
Return the target machine (if available).
Reimplemented from llvm::ExecutionEngine.
|
inlineoverridevirtual |
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 272 of file MCJIT.h.
References llvm::RuntimeDyld::mapSectionAddress().
|
protected |
Definition at line 664 of file MCJIT.cpp.
References llvm::StringRef::data(), llvm::object::Binary::getData(), and llvm::ExecutionEngine::lock.
Referenced by ~MCJIT().
|
protected |
Definition at line 654 of file MCJIT.cpp.
References llvm::StringRef::data(), llvm::object::Binary::getData(), and llvm::ExecutionEngine::lock.
Referenced by addObjectFile(), and generateCodeForModule().
|
inlinestatic |
Definition at line 291 of file MCJIT.h.
References createJIT(), and llvm::ExecutionEngine::MCJITCtor.
|
overridevirtual |
Registers a listener to be called back on various events within the JIT.
See JITEventListener.h for more details. Does not take ownership of the argument. The argument may be NULL, in which case these functions do nothing.
Reimplemented from llvm::ExecutionEngine.
Definition at line 636 of file MCJIT.cpp.
References llvm::ExecutionEngine::lock.
removeModule - Removes a Module from the list of modules, but does not free the module's memory.
Returns true if M is found, in which case the caller assumes responsibility for deleting the module.
Reimplemented from llvm::ExecutionEngine.
Definition at line 114 of file MCJIT.cpp.
References llvm::ExecutionEngine::lock.
|
overridevirtual |
runFunction - Execute the specified function with the specified arguments, and return the result.
For MCJIT execution engines, clients are encouraged to use the "GetFunctionAddress" method (rather than runFunction) and cast the returned uint64_t to the desired function pointer type. However, for backwards compatibility MCJIT's implementation can execute 'main-like' function (i.e. those returning void or int, and taking either no arguments or (int, char*[])).
Implements llvm::ExecutionEngine.
Definition at line 511 of file MCJIT.cpp.
References assert(), llvm::BitWidth, llvm::Type::DoubleTyID, llvm::GenericValue::DoubleVal, llvm::ArrayRef< T >::empty(), F, finalizeModule(), llvm::Type::FloatTyID, llvm::GenericValue::FloatVal, llvm::Type::FP128TyID, llvm::FunctionType::getNumParams(), llvm::FunctionType::getParamType(), getPointerToFunction(), llvm::FunctionType::getReturnType(), llvm::GVTOP(), llvm::Type::IntegerTyID, llvm::GenericValue::IntVal, llvm::Type::isIntegerTy(), llvm::Type::isPointerTy(), llvm::FunctionType::isVarArg(), llvm_unreachable, llvm::Type::PointerTyID, llvm::Type::PPC_FP128TyID, llvm::PTOGV(), llvm::report_fatal_error(), RetTy, llvm::ArrayRef< T >::size(), llvm::Type::VoidTyID, and llvm::Type::X86_FP80TyID.
|
overridevirtual |
runStaticConstructorsDestructors - This method is used to execute all of the static constructors or destructors for a program.
isDtors | - Run the destructors instead of constructors. |
Reimplemented from llvm::ExecutionEngine.
|
overridevirtual |
Sets the object manager that MCJIT should use to avoid compilation.
Reimplemented from llvm::ExecutionEngine.
Definition at line 141 of file MCJIT.cpp.
References llvm::ExecutionEngine::lock.
|
inlineoverridevirtual |
setProcessAllSections (MCJIT Only): By default, only sections that are "required for execution" are passed to the RTDyldMemoryManager, and other sections are discarded.
Passing 'true' to this method will cause RuntimeDyld to pass all sections to its RTDyldMemoryManager regardless of whether they are "required to execute" in the usual sense.
Rationale: Some MCJIT clients want to be able to inspect metadata sections (e.g. Dwarf, Stack-maps) to enable functionality or analyze performance. Passing these sections to the memory manager allows the client to make policy about the relevant sections, rather than having MCJIT do it.
Reimplemented from llvm::ExecutionEngine.
Definition at line 227 of file MCJIT.h.
References llvm::RuntimeDyld::setProcessAllSections().
|
overridevirtual |
Reimplemented from llvm::ExecutionEngine.
Definition at line 643 of file MCJIT.cpp.
References llvm::find(), I, llvm::ExecutionEngine::lock, llvm::reverse(), and std::swap().