LLVM  14.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::orc::EPCDynamicLibrarySearchGenerator Class Reference

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

Inheritance diagram for llvm::orc::EPCDynamicLibrarySearchGenerator:
Inheritance graph
[legend]
Collaboration diagram for llvm::orc::EPCDynamicLibrarySearchGenerator:
Collaboration graph
[legend]

Public Types

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

Public Member Functions

 EPCDynamicLibrarySearchGenerator (ExecutionSession &ES, tpctypes::DylibHandle H, SymbolPredicate Allow=SymbolPredicate())
 Create a DynamicLibrarySearchGenerator that searches for symbols in the library with the given handle. More...
 
Error tryToGenerate (LookupState &LS, LookupKind K, JITDylib &JD, JITDylibLookupFlags JDLookupFlags, const SymbolLookupSet &Symbols) override
 DefinitionGenerators should override this method to insert new definitions into the parent JITDylib. More...
 
- Public Member Functions inherited from llvm::orc::DefinitionGenerator
virtual ~DefinitionGenerator ()
 

Static Public Member Functions

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

Detailed Description

Definition at line 25 of file EPCDynamicLibrarySearchGenerator.h.

Member Typedef Documentation

◆ SymbolPredicate

Definition at line 27 of file EPCDynamicLibrarySearchGenerator.h.

Constructor & Destructor Documentation

◆ EPCDynamicLibrarySearchGenerator()

llvm::orc::EPCDynamicLibrarySearchGenerator::EPCDynamicLibrarySearchGenerator ( ExecutionSession ES,
tpctypes::DylibHandle  H,
SymbolPredicate  Allow = SymbolPredicate() 
)
inline

Create a DynamicLibrarySearchGenerator that searches for symbols in the library with the given handle.

If the Allow predicate is given then only symbols matching the predicate will be searched for. If the predicate is not given then all symbols will be searched for.

Definition at line 35 of file EPCDynamicLibrarySearchGenerator.h.

References H.

Member Function Documentation

◆ GetForTargetProcess()

static Expected<std::unique_ptr<EPCDynamicLibrarySearchGenerator> > llvm::orc::EPCDynamicLibrarySearchGenerator::GetForTargetProcess ( ExecutionSession ES,
SymbolPredicate  Allow = SymbolPredicate() 
)
inlinestatic

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

Definition at line 50 of file EPCDynamicLibrarySearchGenerator.h.

References Load(), and move.

◆ Load()

Expected< std::unique_ptr< EPCDynamicLibrarySearchGenerator > > llvm::orc::EPCDynamicLibrarySearchGenerator::Load ( ExecutionSession ES,
const char *  LibraryPath,
SymbolPredicate  Allow = SymbolPredicate() 
)
static

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

On failure returns the reason the library failed to load.

Definition at line 15 of file EPCDynamicLibrarySearchGenerator.cpp.

References llvm::orc::ExecutionSession::getExecutorProcessControl(), llvm::orc::ExecutorProcessControl::loadDylib(), and move.

Referenced by GetForTargetProcess().

◆ tryToGenerate()

Error llvm::orc::EPCDynamicLibrarySearchGenerator::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 26 of file EPCDynamicLibrarySearchGenerator.cpp.

References llvm::orc::absoluteSymbols(), llvm::orc::SymbolLookupSet::add(), assert(), llvm::orc::JITDylib::define(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty(), llvm::JITSymbolFlags::Exported, llvm::orc::ExecutorProcessControl::lookupSymbols(), move, llvm::orc::SymbolLookupSet::size(), llvm::Error::success(), and llvm::orc::WeaklyReferencedSymbol.


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