LLVM 22.0.0git
llvm::orc::ExecutorResolutionGenerator Class Reference

#include "llvm/ExecutionEngine/Orc/ExecutorResolutionGenerator.h"

Inheritance diagram for llvm::orc::ExecutorResolutionGenerator:
[legend]

Public Types

using SymbolPredicate = unique_function<bool(const SymbolStringPtr &)>
using AbsoluteSymbolsFn

Public Member Functions

 ExecutorResolutionGenerator (ExecutionSession &ES, tpctypes::ResolverHandle H, SymbolPredicate Allow=SymbolPredicate(), AbsoluteSymbolsFn AbsoluteSymbols=absoluteSymbols)
 ExecutorResolutionGenerator (ExecutionSession &ES, SymbolPredicate Allow=SymbolPredicate(), AbsoluteSymbolsFn AbsoluteSymbols=absoluteSymbols)
Error tryToGenerate (LookupState &LS, LookupKind K, JITDylib &JD, JITDylibLookupFlags JDLookupFlags, const SymbolLookupSet &LookupSet) override
 DefinitionGenerators should override this method to insert new definitions into the parent JITDylib.
Public Member Functions inherited from llvm::orc::DefinitionGenerator
virtual ~DefinitionGenerator ()

Static Public Member Functions

static Expected< std::unique_ptr< ExecutorResolutionGenerator > > Load (ExecutionSession &ES, const char *LibraryPath, SymbolPredicate Allow=SymbolPredicate(), AbsoluteSymbolsFn AbsoluteSymbols=absoluteSymbols)
 Permanently loads the library at the given path and, on success, returns an ExecutorResolutionGenerator that will search it for symbol definitions in the library.
static Expected< std::unique_ptr< ExecutorResolutionGenerator > > GetForTargetProcess (ExecutionSession &ES, SymbolPredicate Allow=SymbolPredicate(), AbsoluteSymbolsFn AbsoluteSymbols=absoluteSymbols)
 Creates a ExecutorResolutionGenerator that searches for symbols in the target process.

Detailed Description

Definition at line 24 of file ExecutorResolutionGenerator.h.

Member Typedef Documentation

◆ AbsoluteSymbolsFn

Initial value:
unique_function is a type-erasing functor similar to std::function.
DenseMap< SymbolStringPtr, ExecutorSymbolDef > SymbolMap
A map from symbol names (as SymbolStringPtrs) to JITSymbols (address/flags pairs).

Definition at line 27 of file ExecutorResolutionGenerator.h.

◆ SymbolPredicate

Constructor & Destructor Documentation

◆ ExecutorResolutionGenerator() [1/2]

llvm::orc::ExecutorResolutionGenerator::ExecutorResolutionGenerator ( ExecutionSession & ES,
tpctypes::ResolverHandle H,
SymbolPredicate Allow = SymbolPredicate(),
AbsoluteSymbolsFn AbsoluteSymbols = absoluteSymbols )
inline

◆ ExecutorResolutionGenerator() [2/2]

llvm::orc::ExecutorResolutionGenerator::ExecutorResolutionGenerator ( ExecutionSession & ES,
SymbolPredicate Allow = SymbolPredicate(),
AbsoluteSymbolsFn AbsoluteSymbols = absoluteSymbols )
inline

Member Function Documentation

◆ GetForTargetProcess()

Expected< std::unique_ptr< ExecutorResolutionGenerator > > llvm::orc::ExecutorResolutionGenerator::GetForTargetProcess ( ExecutionSession & ES,
SymbolPredicate Allow = SymbolPredicate(),
AbsoluteSymbolsFn AbsoluteSymbols = absoluteSymbols )
inlinestatic

Creates a ExecutorResolutionGenerator that searches for symbols in the target process.

Definition at line 55 of file ExecutorResolutionGenerator.h.

References llvm::orc::absoluteSymbols(), llvm::orc::DefinitionGenerator::ExecutionSession, and Load().

◆ Load()

Expected< std::unique_ptr< ExecutorResolutionGenerator > > llvm::orc::ExecutorResolutionGenerator::Load ( ExecutionSession & ES,
const char * LibraryPath,
SymbolPredicate Allow = SymbolPredicate(),
AbsoluteSymbolsFn AbsoluteSymbols = absoluteSymbols )
static

Permanently loads the library at the given path and, on success, returns an ExecutorResolutionGenerator that will search it for symbol definitions in the library.

On failure returns the reason the library failed to load.

Definition at line 21 of file ExecutorResolutionGenerator.cpp.

References llvm::orc::DefinitionGenerator::ExecutionSession, llvm::orc::ExecutorProcessControl::getDylibMgr(), llvm::orc::ExecutionSession::getExecutorProcessControl(), and llvm::orc::DylibManager::loadDylib().

Referenced by GetForTargetProcess().

◆ tryToGenerate()

Error llvm::orc::ExecutorResolutionGenerator::tryToGenerate ( LookupState & LS,
LookupKind K,
JITDylib & JD,
JITDylibLookupFlags JDLookupFlags,
const SymbolLookupSet & LookupSet )
overridevirtual

DefinitionGenerators should override this method to insert new definitions into the parent JITDylib.

K specifies the kind of this lookup. JD specifies the target JITDylib being searched, and JDLookupFlags specifies whether the search should match against hidden symbols. Finally, Symbols describes the set of unresolved symbols and their associated lookup flags.

Implements llvm::orc::DefinitionGenerator.

Definition at line 31 of file ExecutorResolutionGenerator.cpp.

References assert(), llvm::dbgs(), llvm::orc::JITDylib::define(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::empty(), llvm::orc::SymbolLookupSet::empty(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), LLVM_DEBUG, LLVM_UNLIKELY, llvm::make_error(), llvm::orc::RequiredSymbol, llvm::orc::Result, and llvm::Error::success().


The documentation for this class was generated from the following files: