|
LLVM
7.0.0
|
Base utilities for ExecutionSession. More...
#include "llvm/ExecutionEngine/Orc/Core.h"
Public Types | |
| using | ErrorReporter = std::function< void(Error)> |
| For reporting errors. More... | |
| using | DispatchMaterializationFunction = std::function< void(VSO &V, std::unique_ptr< MaterializationUnit > MU)> |
| For dispatching MaterializationUnit::materialize calls. More... | |
| using | LegacyAsyncLookupFunction = std::function< SymbolNameSet(std::shared_ptr< AsynchronousSymbolQuery > Q, SymbolNameSet Names)> |
Public Member Functions | |
| ExecutionSessionBase (std::shared_ptr< SymbolStringPool > SSP=nullptr) | |
| Construct an ExecutionSessionBase. More... | |
| SymbolStringPool & | getSymbolStringPool () const |
| Returns the SymbolStringPool for this ExecutionSession. More... | |
| template<typename Func > | |
| auto | runSessionLocked (Func &&F) -> decltype(F()) |
| Run the given lambda with the session mutex locked. More... | |
| ExecutionSessionBase & | setErrorReporter (ErrorReporter ReportError) |
| Set the error reporter function. More... | |
| ExecutionSessionBase & | setDispatchMaterialization (DispatchMaterializationFunction DispatchMaterialization) |
| Set the materialization dispatch function. More... | |
| void | reportError (Error Err) |
| Report a error for this execution session. More... | |
| VModuleKey | allocateVModule () |
| Allocate a module key for a new module to add to the JIT. More... | |
| void | releaseVModule (VModuleKey Key) |
| Return a module key to the ExecutionSession so that it can be re-used. More... | |
| void | legacyFailQuery (AsynchronousSymbolQuery &Q, Error Err) |
| Expected< SymbolMap > | legacyLookup (ExecutionSessionBase &ES, LegacyAsyncLookupFunction AsyncLookup, SymbolNameSet Names, bool WaiUntilReady, RegisterDependenciesFunction RegisterDependencies) |
| A legacy lookup function for JITSymbolResolverAdapter. More... | |
| void | lookup (const VSOList &VSOs, const SymbolNameSet &Symbols, SymbolsResolvedCallback OnResolve, SymbolsReadyCallback OnReady, RegisterDependenciesFunction RegisterDependencies) |
| Search the given VSO list for the given symbols. More... | |
| Expected< SymbolMap > | lookup (const VSOList &VSOs, const SymbolNameSet &Symbols, RegisterDependenciesFunction RegisterDependencies, bool WaitUntilReady=true) |
| Blocking version of lookup above. More... | |
| void | dispatchMaterialization (VSO &V, std::unique_ptr< MaterializationUnit > MU) |
| Materialize the given unit. More... | |
Friends | |
| class | VSO |
Base utilities for ExecutionSession.
| using llvm::orc::ExecutionSessionBase::DispatchMaterializationFunction = std::function<void(VSO &V, std::unique_ptr<MaterializationUnit> MU)> |
| using llvm::orc::ExecutionSessionBase::ErrorReporter = std::function<void(Error)> |
| using llvm::orc::ExecutionSessionBase::LegacyAsyncLookupFunction = std::function<SymbolNameSet( std::shared_ptr<AsynchronousSymbolQuery> Q, SymbolNameSet Names)> |
|
inline |
Construct an ExecutionSessionBase.
SymbolStringPools may be shared between ExecutionSessions.
|
inline |
|
inline |
|
inline |
Returns the SymbolStringPool for this ExecutionSession.
Definition at line 367 of file Core.h.
Referenced by llvm::orc::JITSymbolResolverAdapter::lookup(), llvm::orc::JITSymbolResolverAdapter::lookupFlags(), and llvm::orc::MangleAndInterner::operator()().
| void llvm::orc::ExecutionSessionBase::legacyFailQuery | ( | AsynchronousSymbolQuery & | Q, |
| Error | Err | ||
| ) |
Definition at line 145 of file Core.cpp.
Referenced by llvm::orc::lookupWithLegacyFn().
| Expected< SymbolMap > llvm::orc::ExecutionSessionBase::legacyLookup | ( | ExecutionSessionBase & | ES, |
| LegacyAsyncLookupFunction | AsyncLookup, | ||
| SymbolNameSet | Names, | ||
| bool | WaiUntilReady, | ||
| RegisterDependenciesFunction | RegisterDependencies | ||
| ) |
A legacy lookup function for JITSymbolResolverAdapter.
Do not use – this will be removed soon.
Definition at line 161 of file Core.cpp.
References _, llvm::Lock, and llvm::Error::success().
Referenced by llvm::orc::JITSymbolResolverAdapter::lookup().
| void llvm::orc::ExecutionSessionBase::lookup | ( | const VSOList & | VSOs, |
| const SymbolNameSet & | Symbols, | ||
| SymbolsResolvedCallback | OnResolve, | ||
| SymbolsReadyCallback | OnReady, | ||
| RegisterDependenciesFunction | RegisterDependencies | ||
| ) |
Search the given VSO list for the given symbols.
The OnResolve callback will be called once all requested symbols are resolved, or if an error occurs prior to resolution.
The OnReady callback will be called once all requested symbols are ready, or if an error occurs after resolution but before all symbols are ready.
If all symbols are found, the RegisterDependencies function will be called while the session lock is held. This gives clients a chance to register dependencies for on the queried symbols for any symbols they are materializing (if a MaterializationResponsibility instance is present, this can be implemented by calling MaterializationResponsibility::addDependencies). If there are no dependenant symbols for this query (e.g. it is being made by a top level client to get an address to call) then the value NoDependenciesToRegister can be used.
Definition at line 293 of file Core.cpp.
References assert(), and llvm::Lock.
Referenced by llvm::orc::lookup().
| Expected< SymbolMap > llvm::orc::ExecutionSessionBase::lookup | ( | const VSOList & | VSOs, |
| const SymbolNameSet & | Symbols, | ||
| RegisterDependenciesFunction | RegisterDependencies, | ||
| bool | WaitUntilReady = true |
||
| ) |
Blocking version of lookup above.
Returns the resolved symbol map. If WaitUntilReady is true (the default), will not return until all requested symbols are ready (or an error occurs). If WaitUntilReady is false, will return as soon as all requested symbols are resolved, or an error occurs. If WaitUntilReady is false and an error occurs after resolution, the function will return a success value, but the error will be reported via reportErrors.
Definition at line 368 of file Core.cpp.
References _, llvm::Lock, and llvm::Error::success().
|
inline |
Return a module key to the ExecutionSession so that it can be re-used.
This should only be done once all resources associated with the original key have been released.
|
inline |
Report a error for this execution session.
Unhandled errors can be sent here to log them.
Definition at line 391 of file Core.h.
Referenced by llvm::orc::ObjectTransformLayer2::emit(), llvm::orc::IRTransformLayer2::emit(), llvm::orc::IRCompileLayer2::emit(), and llvm::orc::RTDyldObjectLinkingLayer2::emit().
|
inline |
Run the given lambda with the session mutex locked.
Definition at line 370 of file Core.h.
References F(), and llvm::Lock.
|
inline |
|
inline |
1.8.13