13#ifndef LLVM_EXECUTIONENGINE_ORC_JITLINKREDIRECABLESYMBOLMANAGER_H
14#define LLVM_EXECUTIONENGINE_ORC_JITLINKREDIRECABLESYMBOLMANAGER_H
33 ObjLinkingLayer.getExecutionSession().getTargetTriple()));
35 ObjLinkingLayer.getExecutionSession().getTargetTriple()));
36 if (!AnonymousPtrCreator || !PtrJumpStubCreator)
39 return std::unique_ptr<RedirectableSymbolManager>(
41 ObjLinkingLayer, AnonymousPtrCreator, PtrJumpStubCreator));
48 : ObjLinkingLayer(ObjLinkingLayer),
49 AnonymousPtrCreator(
std::
move(AnonymousPtrCreator)),
50 PtrJumpStubCreator(
std::
move(PtrJumpStubCreator)) {}
54 void emitRedirectableSymbols(std::unique_ptr<MaterializationResponsibility> R,
63 std::atomic_size_t StubGraphIdx{0};
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
Represents a JIT'd dynamic library.
ObjectLinkingLayer & getObjectLinkingLayer() const
static Expected< std::unique_ptr< RedirectableSymbolManager > > Create(ObjectLinkingLayer &ObjLinkingLayer)
Create redirection manager that uses JITLink based implementaion.
JITLinkRedirectableSymbolManager(ObjectLinkingLayer &ObjLinkingLayer, jitlink::AnonymousPointerCreator &AnonymousPtrCreator, jitlink::PointerJumpStubCreator &PtrJumpStubCreator)
An ObjectLayer implementation built on JITLink.
Base class for managing redirectable symbols in which a call gets redirected to another symbol in run...
LLVM_ABI PointerJumpStubCreator getPointerJumpStubCreator(const Triple &TT)
Get target-specific PointerJumpStubCreator.
unique_function< Symbol &( LinkGraph &G, Section &StubSection, Symbol &PointerSymbol)> PointerJumpStubCreator
Create a jump stub that jumps via the pointer at the given symbol and an anonymous symbol pointing to...
unique_function< Symbol &(LinkGraph &G, Section &PointerSection, Symbol *InitialTarget, uint64_t InitialAddend)> AnonymousPointerCreator
Creates a new pointer block in the given section and returns an Anonymous symbol pointing to it.
LLVM_ABI AnonymousPointerCreator getAnonymousPointerCreator(const Triple &TT)
Get target-specific AnonymousPointerCreator.
DenseMap< SymbolStringPtr, ExecutorSymbolDef > SymbolMap
A map from symbol names (as SymbolStringPtrs) to JITSymbols (address/flags pairs).
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.