15 void SymbolResolver::anchor() {}
19 : ES(ES), R(R), MR(MR) {}
24 for (
auto &S : Symbols)
28 if (!InternedResult) {
29 OnResolved(InternedResult.takeError());
34 for (
auto &KV : *InternedResult)
35 Result[*KV.first] = std::move(KV.second);
39 auto Q = std::make_shared<AsynchronousSymbolQuery>(
40 InternedSymbols, OnResolvedWithUnwrap,
43 auto Unresolved = R.
lookup(Q, InternedSymbols);
44 if (Unresolved.empty()) {
48 ES.
legacyFailQuery(*Q, make_error<SymbolsNotFound>(std::move(Unresolved)));
54 for (
auto &S : Symbols)
59 for (
auto &S : InternedResult) {
60 ResolvedStrings.insert(S);
std::function< void(Expected< LookupResult >)> OnResolvedFunction
This class represents lattice values for constants.
virtual SymbolNameSet getResponsibilitySet(const SymbolNameSet &Symbols)=0
Returns the subset of the given symbols that the caller is responsible for materializing.
std::set< StringRef > LookupSet
Expected< LookupSet > getResponsibilitySet(const LookupSet &Symbols) override
Returns the subset of the given symbols that should be materialized by the caller.
SymbolStringPtr intern(StringRef SymName)
Add a symbol name to the SymbolStringPool and return a pointer to it.
Tagged union holding either a T or a Error.
Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and...
void legacyFailQuery(AsynchronousSymbolQuery &Q, Error Err)
JITSymbolResolverAdapter(ExecutionSession &ES, SymbolResolver &R, MaterializationResponsibility *MR)
std::pair< iterator, bool > insert(const ValueT &V)
void addDependenciesForAll(const SymbolDependenceMap &Dependencies)
Add dependencies that apply to all symbols covered by this instance.
An ExecutionSession represents a running JIT program.
SymbolResolver is a composable interface for looking up symbol flags and addresses using the Asynchro...
virtual SymbolNameSet lookup(std::shared_ptr< AsynchronousSymbolQuery > Query, SymbolNameSet Symbols)=0
For each symbol in Symbols that can be found, assigns that symbols value in Query.
void reportError(Error Err)
Report a error for this execution session.
std::map< StringRef, JITEvaluatedSymbol > LookupResult
Lightweight error class with error context and mandatory checking.
void lookup(const LookupSet &Symbols, OnResolvedFunction OnResolved) override
Returns the fully resolved address and flags for each of the given symbols.