16 #ifndef LLVM_EXECUTIONENGINE_ORC_LAZYREEXPORTS_H 17 #define LLVM_EXECUTIONENGINE_ORC_LAZYREEXPORTS_H 52 virtual void anchor();
55 template <
typename NotifyResolvedImpl>
59 : NotifyResolved(
std::move(NotifyResolved)) {}
62 return NotifyResolved(SourceJD, SymbolName, ResolvedAddr);
66 NotifyResolvedImpl NotifyResolved;
71 template <
typename NotifyResolvedImpl>
72 static std::unique_ptr<NotifyResolvedFunction>
74 return std::make_unique<NotifyResolvedFunctionImpl<NotifyResolvedImpl>>(
75 std::move(NotifyResolved));
82 std::shared_ptr<NotifyResolvedFunction> NotifyResolved);
87 std::unique_ptr<TrampolinePool> TP);
92 this->TP = std::move(TP);
97 std::map<JITTargetAddress, std::pair<JITDylib *, SymbolStringPtr>>;
100 std::map<JITTargetAddress, std::shared_ptr<NotifyResolvedFunction>>;
102 std::mutex LCTMMutex;
105 std::unique_ptr<TrampolinePool> TP;
106 ReexportsMap Reexports;
107 NotifiersMap Notifiers;
117 template <
typename ORCABI>
Error init() {
124 return TP.takeError();
133 template <
typename ORCABI>
136 auto LLCTM = std::unique_ptr<LocalLazyCallThroughManager>(
139 if (
auto Err = LLCTM->init<ORCABI>())
140 return std::move(Err);
142 return std::move(LLCTM);
176 std::shared_ptr<LazyCallThroughManager::NotifyResolvedFunction>
184 inline std::unique_ptr<LazyReexportsMaterializationUnit>
189 return std::make_unique<LazyReexportsMaterializationUnit>(
190 LCTManager, ISManager, SourceJD, std::move(CallableAliases), SrcJDLoc,
197 #endif // LLVM_EXECUTIONENGINE_ORC_LAZYREEXPORTS_H
Base class for managing collections of named indirect stubs.
static Expected< std::unique_ptr< LocalLazyCallThroughManager > > Create(ExecutionSession &ES, JITTargetAddress ErrorHandlerAddr)
Create a LocalLazyCallThroughManager using the given ABI.
This class represents lattice values for constants.
static std::unique_ptr< NotifyResolvedFunction > createNotifyResolvedFunction(NotifyResolvedImpl NotifyResolved)
Create a shared NotifyResolvedFunction from a given type that is callable with the correct signature...
Clients will want to take some action on first resolution, e.g.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
static Expected< std::unique_ptr< LocalTrampolinePool > > Create(GetTrampolineLandingFunction GetTrampolineLanding)
Creates a LocalTrampolinePool with the given RunCallback function.
JITTargetAddress callThroughToSymbol(JITTargetAddress TrampolineAddr)
constexpr char SymbolName[]
Key for Kernel::Metadata::mSymbolName.
static StringRef getName(Value *V)
Tagged union holding either a T or a Error.
A materialization unit that builds lazy re-exports.
Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and...
uint64_t JITTargetAddress
Represents an address in the target process's address space.
virtual Error operator()(JITDylib &SourceJD, const SymbolStringPtr &SymbolName, JITTargetAddress ResolvedAddr)=0
Called the first time a lazy call through is executed and the target symbol resolved.
Pointer to a pooled string representing a symbol name.
LazyCallThroughManager(ExecutionSession &ES, JITTargetAddress ErrorHandlerAddr, std::unique_ptr< TrampolinePool > TP)
initializer< Ty > init(const Ty &Val)
virtual ~NotifyResolvedFunction()
std::unique_ptr< LazyReexportsMaterializationUnit > lazyReexports(LazyCallThroughManager &LCTManager, IndirectStubsManager &ISManager, JITDylib &SourceJD, SymbolAliasMap CallableAliases, ImplSymbolMap *SrcJDLoc=nullptr, VModuleKey K=VModuleKey())
Define lazy-reexports based on the given SymbolAliasMap.
Error operator()(JITDylib &SourceJD, const SymbolStringPtr &SymbolName, JITTargetAddress ResolvedAddr)
Called the first time a lazy call through is executed and the target symbol resolved.
void setTrampolinePool(std::unique_ptr< TrampolinePool > TP)
Triple - Helper class for working with autoconf configuration names.
A MaterializationUnit represents a set of symbol definitions that can be materialized as a group...
static ErrorSuccess success()
Create a success value.
Expected< std::unique_ptr< LazyCallThroughManager > > createLocalLazyCallThroughManager(const Triple &T, ExecutionSession &ES, JITTargetAddress ErrorHandlerAddr)
Create a LocalLazyCallThroughManager from the given triple and execution session. ...
NotifyResolvedFunctionImpl(NotifyResolvedImpl NotifyResolved)
An ExecutionSession represents a running JIT program.
uint8_t uint64_t VModuleKey
VModuleKey provides a unique identifier (allocated and managed by ExecutionSessions) for a module add...
Expected< JITTargetAddress > getCallThroughTrampoline(JITDylib &SourceJD, SymbolStringPtr SymbolName, std::shared_ptr< NotifyResolvedFunction > NotifyResolved)
A lazy call-through manager that builds trampolines in the current process.
Manages a set of 'lazy call-through' trampolines.
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
A symbol table that supports asynchoronous symbol queries.