14#define DEBUG_TYPE "orc"
27 dbgs() <<
"InstanceSymbolGenerator trying to generate " << Symbols <<
"\n";
34 for (
auto &[Name, Flags] : Symbols)
38 [&JD, LS = std::move(LS),
41 return LS.continueLookup(
Result.takeError());
43 if (
Result->size() != LookupSymbols.size())
45 "Instance symbol lookup returned " +
Twine(
Result->size()) +
46 " results for " +
Twine(LookupSymbols.size()) +
" symbols",
50 auto ResultIt =
Result->begin();
51 for (
auto &[Name, Flags] : LookupSymbols) {
52 const auto &Addr = *ResultIt++;
58 dbgs() <<
"InstanceSymbolGenerator lookup returned " << NewSymbols
62 if (NewSymbols.
empty())
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
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.
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.
ExecutionSession & getExecutionSession() const
Get a reference to the ExecutionSession for 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.
DenseMap< SymbolStringPtr, ExecutorSymbolDef > SymbolMap
A map from symbol names (as SymbolStringPtrs) to JITSymbols (address/flags pairs).
LookupKind
Describes the kind of lookup being performed.
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.