|
LLVM
7.0.0
|
A symbol table that supports asynchoronous symbol queries. More...
#include "llvm/ExecutionEngine/Orc/Core.h"
Public Types | |
| using | FallbackDefinitionGeneratorFunction = std::function< SymbolNameSet(VSO &Parent, const SymbolNameSet &Names)> |
| using | AsynchronousSymbolQuerySet = std::set< std::shared_ptr< AsynchronousSymbolQuery > > |
Public Member Functions | |
| VSO (const VSO &)=delete | |
| VSO & | operator= (const VSO &)=delete |
| VSO (VSO &&)=delete | |
| VSO & | operator= (VSO &&)=delete |
| const std::string & | getName () const |
| Get the name for this VSO. More... | |
| ExecutionSessionBase & | getExecutionSession () const |
| Get a reference to the ExecutionSession for this VSO. More... | |
| void | setFallbackDefinitionGenerator (FallbackDefinitionGeneratorFunction FallbackDefinitionGenerator) |
| Set a fallback defenition generator. More... | |
| void | setSearchOrder (VSOList NewSearchOrder, bool SearchThisVSOFirst=true) |
| Set the search order to be used when fixing up definitions in VSO. More... | |
| void | addToSearchOrder (VSO &V) |
| Add the given VSO to the search order for definitions in this VSO. More... | |
| void | replaceInSearchOrder (VSO &OldV, VSO &NewV) |
| Replace OldV with NewV in the search order if OldV is present. More... | |
| void | removeFromSearchOrder (VSO &V) |
| Remove the given VSO from the search order for this VSO if it is present. More... | |
| template<typename Func > | |
| auto | withSearchOrderDo (Func &&F) -> decltype(F(std::declval< const VSOList &>())) |
| Do something with the search order (run under the session lock). More... | |
| template<typename UniquePtrToMaterializationUnit > | |
| std::enable_if< std::is_convertible< typename std::decay< UniquePtrToMaterializationUnit >::type, std::unique_ptr< MaterializationUnit > >::value, Error >::type | define (UniquePtrToMaterializationUnit &&MU) |
| Define all symbols provided by the materialization unit to be part of the given VSO. More... | |
| SymbolFlagsMap | lookupFlags (const SymbolNameSet &Names) |
| Search the given VSO for the symbols in Symbols. More... | |
| void | dump (raw_ostream &OS) |
| Dump current VSO state to OS. More... | |
| SymbolNameSet | legacyLookup (std::shared_ptr< AsynchronousSymbolQuery > Q, SymbolNameSet Names) |
| FIXME: Remove this when we remove the old ORC layers. More... | |
Friends | |
| class | AsynchronousSymbolQuery |
| class | ExecutionSession |
| class | ExecutionSessionBase |
| class | MaterializationResponsibility |
A symbol table that supports asynchoronous symbol queries.
Represents a virtual shared object. Instances can not be copied or moved, so their addresses may be used as keys for resource management. VSO state changes must be made via an ExecutionSession to guarantee that they are synchronized with respect to other VSO operations.
| using llvm::orc::VSO::AsynchronousSymbolQuerySet = std::set<std::shared_ptr<AsynchronousSymbolQuery> > |
| using llvm::orc::VSO::FallbackDefinitionGeneratorFunction = std::function<SymbolNameSet(VSO &Parent, const SymbolNameSet &Names)> |
|
delete |
| void llvm::orc::VSO::addToSearchOrder | ( | VSO & | V | ) |
|
inline |
Define all symbols provided by the materialization unit to be part of the given VSO.
defineImpl succeeded.
Definition at line 621 of file Core.h.
References assert().
Referenced by llvm::orc::IRLayer::add(), llvm::orc::ObjectLayer::add(), llvm::orc::LLJIT::defineAbsolute(), llvm::orc::LocalCXXRuntimeOverrides2::enable(), and llvm::orc::DynamicLibraryFallbackGenerator::operator()().
| void llvm::orc::VSO::dump | ( | raw_ostream & | OS | ) |
Dump current VSO state to OS.
Definition at line 1474 of file Core.cpp.
References assert(), llvm::orc::MaterializationUnit::doDiscard(), llvm::find_if(), llvm::format(), llvm::orc::MaterializationUnit::getSymbols(), I, llvm::JITSymbolFlags::Lazy, llvm::JITSymbolFlags::Materializing, MI, llvm::Error::success(), and VSO().
|
inline |
Get a reference to the ExecutionSession for this VSO.
Definition at line 565 of file Core.h.
Referenced by llvm::orc::ReExportsMaterializationUnit::ReExportsMaterializationUnit().
|
inline |
| SymbolNameSet llvm::orc::VSO::legacyLookup | ( | std::shared_ptr< AsynchronousSymbolQuery > | Q, |
| SymbolNameSet | Names | ||
| ) |
FIXME: Remove this when we remove the old ORC layers.
Search the given VSOs in order for the symbols in Symbols. Results (once they become available) will be returned via the given Query.
If any symbol is not found then the unresolved symbols will be returned, and the query will not be applied. The Query is not failed and can be re-used in a subsequent lookup once the symbols have been added, or manually failed.
Definition at line 1351 of file Core.cpp.
References assert(), D, E, I, llvm::Lock, llvm::JITSymbolFlags::Materializing, MI, and llvm::None.
| SymbolFlagsMap llvm::orc::VSO::lookupFlags | ( | const SymbolNameSet & | Names | ) |
Search the given VSO for the symbols in Symbols.
If found, store the flags for each symbol in Flags. Returns any unresolved symbols.
Definition at line 1237 of file Core.cpp.
References assert(), D, E, I, llvm::JITSymbolFlags::Materializing, MI, Result, and llvm::JITSymbolFlags::stripTransientFlags().
Referenced by llvm::orc::buildSimpleReexportsAliasMap().
| void llvm::orc::VSO::removeFromSearchOrder | ( | VSO & | V | ) |
Replace OldV with NewV in the search order if OldV is present.
Otherwise this operation is a no-op.
Definition at line 1220 of file Core.cpp.
References llvm::find(), and I.
|
inline |
Set the search order to be used when fixing up definitions in VSO.
This will replace the previous search order, and apply to any symbol resolutions made for definitions in this VSO after the call to setSearchOrder (even if the definition itself was added before the call).
If SearchThisVSOFirst is set, which by default it is, then this VSO will add itself to the beginning of the SearchOrder (Clients should not put this VSO in the list in this case, to avoid redundant lookups).
If SearchThisVSOFirst is false then the search order will be used as given. The main motivation for this feature is to support deliberate shadowing of symbols in this VSO by a facade VSO. For example, the facade may resolve function names to stubs, and the stubs may compile lazily by looking up symbols in this dylib. Adding the facade dylib as the first in the search order (instead of this dylib) ensures that definitions within this dylib resolve to the lazy-compiling stubs, rather than immediately materializing the definitions in this dylib.
|
friend |
|
friend |
|
friend |
|
friend |
1.8.13