16#ifndef LLVM_EXECUTIONENGINE_ORC_LAZYREEXPORTS_H
17#define LLVM_EXECUTIONENGINE_ORC_LAZYREEXPORTS_H
73 using ReexportsMap = std::map<ExecutorAddr, ReexportsEntry>;
75 using NotifiersMap = std::map<ExecutorAddr, NotifyResolvedFunction>;
81 ReexportsMap Reexports;
82 NotifiersMap Notifiers;
94 template <
typename ORCABI>
Error init() {
98 NotifyLandingResolved) {
100 std::move(NotifyLandingResolved));
104 return TP.takeError();
106 this->TP = std::move(*TP);
111 std::unique_ptr<TrampolinePool> TP;
116 template <
typename ORCABI>
119 auto LLCTM = std::unique_ptr<LocalLazyCallThroughManager>(
122 if (
auto Err = LLCTM->init<ORCABI>())
123 return std::move(Err);
125 return std::move(LLCTM);
133 ExecutorAddr ErrorHandlerAddr);
151 void materialize(std::unique_ptr<MaterializationResponsibility> R)
override;
166inline std::unique_ptr<LazyReexportsMaterializationUnit>
171 return std::make_unique<LazyReexportsMaterializationUnit>(
172 LCTManager, ISManager, SourceJD, std::move(CallableAliases), SrcJDLoc);
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.
StringRef - Represent a constant reference to a string, i.e.
Triple - Helper class for working with autoconf configuration names.
An ExecutionSession represents a running JIT program.
Represents an address in the executor process.
Base class for managing collections of named indirect stubs.
Represents a JIT'd dynamic library.
Manages a set of 'lazy call-through' trampolines.
ExecutorAddr reportCallThroughError(Error Err)
Expected< ReexportsEntry > findReexport(ExecutorAddr TrampolineAddr)
Error notifyResolved(ExecutorAddr TrampolineAddr, ExecutorAddr ResolvedAddr)
void setTrampolinePool(TrampolinePool &TP)
void resolveTrampolineLandingAddress(ExecutorAddr TrampolineAddr, TrampolinePool::NotifyLandingResolvedFunction NotifyLandingResolved)
virtual ~LazyCallThroughManager()=default
Expected< ExecutorAddr > getCallThroughTrampoline(JITDylib &SourceJD, SymbolStringPtr SymbolName, NotifyResolvedFunction NotifyResolved)
A materialization unit that builds lazy re-exports.
StringRef getName() const override
Return the name of this materialization unit.
A lazy call-through manager that builds trampolines in the current process.
static Expected< std::unique_ptr< LocalLazyCallThroughManager > > Create(ExecutionSession &ES, ExecutorAddr ErrorHandlerAddr)
Create a LocalLazyCallThroughManager using the given ABI.
static Expected< std::unique_ptr< LocalTrampolinePool > > Create(ResolveLandingFunction ResolveLanding)
Creates a LocalTrampolinePool with the given RunCallback function.
A MaterializationUnit represents a set of symbol definitions that can be materialized as a group,...
Pointer to a pooled string representing a symbol name.
Base class for pools of compiler re-entry trampolines.
unique_function< void(ExecutorAddr) const > NotifyLandingResolvedFunction
unique_function is a type-erasing functor similar to std::function.
Expected< std::unique_ptr< LazyCallThroughManager > > createLocalLazyCallThroughManager(const Triple &T, ExecutionSession &ES, ExecutorAddr ErrorHandlerAddr)
Create a LocalLazyCallThroughManager from the given triple and execution session.
std::unique_ptr< LazyReexportsMaterializationUnit > lazyReexports(LazyCallThroughManager &LCTManager, IndirectStubsManager &ISManager, JITDylib &SourceJD, SymbolAliasMap CallableAliases, ImplSymbolMap *SrcJDLoc=nullptr)
Define lazy-reexports based on the given SymbolAliasMap.
This is an optimization pass for GlobalISel generic memory operations.
SymbolStringPtr SymbolName