15#define DEBUG_TYPE "orc"
20Expected<std::unique_ptr<EPCDynamicLibrarySearchGenerator>>
27 return Handle.takeError();
29 return std::make_unique<EPCDynamicLibrarySearchGenerator>(
30 ES, *Handle, std::move(Allow), std::move(AddAbsoluteSymbols));
41 dbgs() <<
"EPCDynamicLibrarySearchGenerator trying to generate "
47 for (
auto &KV : Symbols) {
49 if (Allow && !Allow(KV.first))
61 dbgs() <<
"EPCDynamicLibrarySearchGenerator lookup failed due to error";
63 return LS.continueLookup(
Result.takeError());
66 assert(
Result->size() == 1 &&
"Results for more than one library returned");
68 "Result has incorrect number of elements");
71 auto ResultI =
Result->front().begin();
72 for (
auto &KV : LookupSymbols) {
73 if (ResultI->getAddress())
74 NewSymbols[KV.first] = *ResultI;
79 dbgs() <<
"EPCDynamicLibrarySearchGenerator lookup returned "
80 << NewSymbols <<
"\n";
84 if (NewSymbols.
empty())
88 Error Err = AddAbsoluteSymbols
89 ? AddAbsoluteSymbols(JD, std::move(NewSymbols))
92 LS.continueLookup(std::move(Err));
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
virtual void lookupSymbolsAsync(ArrayRef< LookupRequest > Request, SymbolLookupCompleteFn F)=0
Search for symbols in the target process.
virtual Expected< tpctypes::DylibHandle > loadDylib(const char *DylibPath)=0
Load the dynamic library at the given path and return a handle to it.
static Expected< std::unique_ptr< EPCDynamicLibrarySearchGenerator > > Load(ExecutionSession &ES, const char *LibraryPath, SymbolPredicate Allow=SymbolPredicate(), AddAbsoluteSymbolsFn AddAbsoluteSymbols=nullptr)
Permanently loads the library at the given path and, on success, returns a DynamicLibrarySearchGenera...
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.
An ExecutionSession represents a running JIT program.
ExecutorProcessControl & getExecutorProcessControl()
Get the ExecutorProcessControl object associated with this ExecutionSession.
DylibManager & getDylibMgr() const
Return the DylibManager for the target process.
Represents a JIT'd dynamic library.
Error define(std::unique_ptr< MaterializationUnitType > &&MU, ResourceTrackerSP RT=nullptr)
Define all symbols provided by the materialization unit to be part of this JITDylib.
Wraps state for a lookup-in-progress.
A set of symbols to look up, each associated with a SymbolLookupFlags value.
SymbolLookupSet & add(SymbolStringPtr Name, SymbolLookupFlags Flags=SymbolLookupFlags::RequiredSymbol)
Add an element to the set.
std::unique_ptr< AbsoluteSymbolsMaterializationUnit > absoluteSymbols(SymbolMap Symbols)
Create an AbsoluteSymbolsMaterializationUnit with the given symbols.
JITDylibLookupFlags
Lookup flags that apply to each dylib in the search order for a lookup.
LookupKind
Describes the kind of lookup being performed.
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
A pair of a dylib and a set of symbols to be looked up.