|
LLVM 23.0.0git
|
A set of symbols to look up, each associated with a SymbolLookupFlags value. More...
#include "llvm/ExecutionEngine/Orc/SymbolLookupSet.h"
Public Types | |
| using | value_type = std::pair<SymbolStringPtr, SymbolLookupFlags> |
| using | UnderlyingVector = std::vector<value_type> |
| using | iterator = UnderlyingVector::iterator |
| using | const_iterator = UnderlyingVector::const_iterator |
Public Member Functions | |
| SymbolLookupSet ()=default | |
| SymbolLookupSet (std::initializer_list< value_type > Elems) | |
| SymbolLookupSet (SymbolStringPtr Name, SymbolLookupFlags Flags=SymbolLookupFlags::RequiredSymbol) | |
| SymbolLookupSet (std::initializer_list< SymbolStringPtr > Names, SymbolLookupFlags Flags=SymbolLookupFlags::RequiredSymbol) | |
| Construct a SymbolLookupSet from an initializer list of SymbolStringPtrs. | |
| SymbolLookupSet (const SymbolNameSet &Names, SymbolLookupFlags Flags=SymbolLookupFlags::RequiredSymbol) | |
| Construct a SymbolLookupSet from a SymbolNameSet with the given Flags used for each value. | |
| SymbolLookupSet (ArrayRef< SymbolStringPtr > Names, SymbolLookupFlags Flags=SymbolLookupFlags::RequiredSymbol) | |
| Construct a SymbolLookupSet from a vector of symbols with the given Flags used for each value. | |
| SymbolLookupSet & | add (SymbolStringPtr Name, SymbolLookupFlags Flags=SymbolLookupFlags::RequiredSymbol) |
| Add an element to the set. | |
| SymbolLookupSet & | append (SymbolLookupSet Other) |
| Quickly append one lookup set to another. | |
| bool | empty () const |
| UnderlyingVector::size_type | size () const |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| void | remove (UnderlyingVector::size_type I) |
| Removes the Ith element of the vector, replacing it with the last element. | |
| void | remove (iterator I) |
| Removes the element pointed to by the given iterator. | |
| template<typename PredFn> | |
| void | remove_if (PredFn &&Pred) |
| Removes all elements matching the given predicate, which must be callable as bool(const SymbolStringPtr &, SymbolLookupFlags Flags). | |
| template<typename BodyFn> | |
| auto | forEachWithRemoval (BodyFn &&Body) -> std::enable_if_t< std::is_same< decltype(Body(std::declval< const SymbolStringPtr & >(), std::declval< SymbolLookupFlags >())), bool >::value > |
| Loop over the elements of this SymbolLookupSet, applying the Body function to each one. | |
| template<typename BodyFn> | |
| auto | forEachWithRemoval (BodyFn &&Body) -> std::enable_if_t< std::is_same< decltype(Body(std::declval< const SymbolStringPtr & >(), std::declval< SymbolLookupFlags >())), Expected< bool > >::value, Error > |
| Loop over the elements of this SymbolLookupSet, applying the Body function to each one. | |
| SymbolNameVector | getSymbolNames () const |
| Construct a SymbolNameVector from this instance by dropping the Flags values. | |
| void | sortByAddress () |
| Sort the lookup set by pointer value. | |
| void | sortByName () |
| Sort the lookup set lexicographically. | |
| void | removeDuplicates () |
| Remove any duplicate elements. | |
| bool | containsDuplicates () |
| Returns true if this set contains any duplicates. | |
Static Public Member Functions | |
| template<typename ValT> | |
| static SymbolLookupSet | fromMapKeys (const DenseMap< SymbolStringPtr, ValT > &M, SymbolLookupFlags Flags=SymbolLookupFlags::RequiredSymbol) |
| Construct a SymbolLookupSet from DenseMap keys. | |
A set of symbols to look up, each associated with a SymbolLookupFlags value.
This class is backed by a vector and optimized for fast insertion, deletion and iteration. It does not guarantee a stable order between operations, and will not automatically detect duplicate elements (they can be manually checked by calling the validate method).
Definition at line 46 of file SymbolLookupSet.h.
| using llvm::orc::SymbolLookupSet::const_iterator = UnderlyingVector::const_iterator |
Definition at line 51 of file SymbolLookupSet.h.
| using llvm::orc::SymbolLookupSet::iterator = UnderlyingVector::iterator |
Definition at line 50 of file SymbolLookupSet.h.
| using llvm::orc::SymbolLookupSet::UnderlyingVector = std::vector<value_type> |
Definition at line 49 of file SymbolLookupSet.h.
| using llvm::orc::SymbolLookupSet::value_type = std::pair<SymbolStringPtr, SymbolLookupFlags> |
Definition at line 48 of file SymbolLookupSet.h.
|
default |
Referenced by append(), and fromMapKeys().
|
inline |
Definition at line 55 of file SymbolLookupSet.h.
References E().
|
inlineexplicit |
Definition at line 60 of file SymbolLookupSet.h.
References add(), and llvm::orc::RequiredSymbol.
|
inlineexplicit |
Construct a SymbolLookupSet from an initializer list of SymbolStringPtrs.
Definition at line 67 of file SymbolLookupSet.h.
References add(), and llvm::orc::RequiredSymbol.
|
inlineexplicit |
Construct a SymbolLookupSet from a SymbolNameSet with the given Flags used for each value.
Definition at line 77 of file SymbolLookupSet.h.
References add(), llvm::orc::RequiredSymbol, and llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::size().
|
inlineexplicit |
Construct a SymbolLookupSet from a vector of symbols with the given Flags used for each value.
If the ArrayRef contains duplicates it is up to the client to remove these before using this instance for lookup.
Definition at line 89 of file SymbolLookupSet.h.
References add(), llvm::orc::RequiredSymbol, and llvm::ArrayRef< T >::size().
|
inline |
Add an element to the set.
The client is responsible for checking that duplicates are not added.
Definition at line 112 of file SymbolLookupSet.h.
References llvm::orc::RequiredSymbol.
Referenced by LLVMOrcExecutionSessionLookup(), llvm::orc::LinkGraphLinkingLayer::JITLinkCtx::lookup(), llvm::orc::CtorDtorRunner::run(), SymbolLookupSet(), SymbolLookupSet(), SymbolLookupSet(), SymbolLookupSet(), llvm::orc::DLLImportDefinitionGenerator::tryToGenerate(), and llvm::orc::EPCDynamicLibrarySearchGenerator::tryToGenerate().
|
inline |
Quickly append one lookup set to another.
Definition at line 119 of file SymbolLookupSet.h.
References llvm::Other, and SymbolLookupSet().
|
inline |
Definition at line 128 of file SymbolLookupSet.h.
Referenced by remove().
|
inline |
Definition at line 130 of file SymbolLookupSet.h.
|
inline |
Returns true if this set contains any duplicates.
This should only be used in assertions.
Definition at line 239 of file SymbolLookupSet.h.
References I, and sortByAddress().
Referenced by llvm::orc::CtorDtorRunner::run().
|
inline |
Definition at line 126 of file SymbolLookupSet.h.
Referenced by llvm::orc::ExecutorResolutionGenerator::tryToGenerate().
|
inline |
Definition at line 129 of file SymbolLookupSet.h.
|
inline |
Definition at line 131 of file SymbolLookupSet.h.
|
inline |
Loop over the elements of this SymbolLookupSet, applying the Body function to each one.
Body must be callable as bool(const SymbolStringPtr &, SymbolLookupFlags). If Body returns true then the element just passed in is removed from the set. If Body returns false then the element is retained.
Definition at line 163 of file SymbolLookupSet.h.
|
inline |
Loop over the elements of this SymbolLookupSet, applying the Body function to each one.
Body must be callable as Expected<bool>(const SymbolStringPtr &, SymbolLookupFlags). If Body returns a failure value, the loop exits immediately. If Body returns true then the element just passed in is removed from the set. If Body returns false then the element is retained.
Definition at line 185 of file SymbolLookupSet.h.
References I, remove(), and llvm::Error::success().
|
inlinestatic |
Construct a SymbolLookupSet from DenseMap keys.
Definition at line 100 of file SymbolLookupSet.h.
References llvm::orc::RequiredSymbol, llvm::orc::Result, and SymbolLookupSet().
Referenced by llvm::orc::ExecutionSession::registerJITDispatchHandlers().
|
inline |
Construct a SymbolNameVector from this instance by dropping the Flags values.
Definition at line 207 of file SymbolLookupSet.h.
|
inline |
|
inline |
Removes the Ith element of the vector, replacing it with the last element.
Definition at line 134 of file SymbolLookupSet.h.
References I, and std::swap().
Referenced by forEachWithRemoval(), forEachWithRemoval(), and remove_if().
|
inline |
Removes all elements matching the given predicate, which must be callable as bool(const SymbolStringPtr &, SymbolLookupFlags Flags).
Definition at line 145 of file SymbolLookupSet.h.
|
inline |
Remove any duplicate elements.
If a SymbolLookupSet is not duplicate-free by construction, this method can be used to turn it into a proper set.
Definition at line 230 of file SymbolLookupSet.h.
References sortByAddress(), and llvm::unique().
|
inline |
Definition at line 127 of file SymbolLookupSet.h.
Referenced by llvm::orc::CAPIDefinitionGenerator::tryToGenerate(), and llvm::orc::EPCDynamicLibrarySearchGenerator::tryToGenerate().
|
inline |
Sort the lookup set by pointer value.
This sort is fast but sensitive to allocation order and so should not be used where a consistent order is required.
Definition at line 218 of file SymbolLookupSet.h.
References llvm::sort().
Referenced by containsDuplicates(), and removeDuplicates().
|
inline |
Sort the lookup set lexicographically.
This sort is slow but the order is unaffected by allocation order.
Definition at line 222 of file SymbolLookupSet.h.
References LHS, RHS, and llvm::sort().