13#ifndef LLVM_EXECUTIONENGINE_ORC_REDIRECTIONMANAGER_H
14#define LLVM_EXECUTIONENGINE_ORC_REDIRECTIONMANAGER_H
35 return redirect(JD, {{std::move(Symbol), NewDest}});
39 virtual void anchor();
70 InitialDests(
std::
move(InitialDests)) {}
73 return "RedirectableSymbolMaterializationUnit";
76 void materialize(std::unique_ptr<MaterializationResponsibility> R)
override {
86 convertToFlags(
const SymbolMap &InitialDests) {
88 for (
auto [K, V] : InitialDests)
89 Flags[K] = V.getFlags();
93 RedirectableSymbolManager &RM;
bool erase(const KeyT &Val)
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
Represents a defining location for a JIT symbol.
Represents a JIT'd dynamic library.
A MaterializationUnit represents a set of symbol definitions that can be materialized as a group,...
RedirectableMaterializationUnit materializes redirectable symbol by invoking RedirectableSymbolManage...
StringRef getName() const override
Return the name of this materialization unit.
RedirectableMaterializationUnit(RedirectableSymbolManager &RM, SymbolMap InitialDests)
void discard(const JITDylib &JD, const SymbolStringPtr &Name) override
Implementations of this method should discard the given symbol from the source (e....
void materialize(std::unique_ptr< MaterializationResponsibility > R) override
Implementations of this method should materialize all symbols in the materialzation unit,...
Base class for managing redirectable symbols in which a call gets redirected to another symbol in run...
Error createRedirectableSymbols(ResourceTrackerSP RT, SymbolMap InitialDests)
Create redirectable symbols with given symbol names and initial desitnation symbol addresses.
Error createRedirectableSymbol(ResourceTrackerSP RT, SymbolStringPtr Symbol, ExecutorSymbolDef InitialDest)
Create a single redirectable symbol with given symbol name and initial desitnation symbol address.
virtual void emitRedirectableSymbols(std::unique_ptr< MaterializationResponsibility > MR, SymbolMap InitialDests)=0
Emit redirectable symbol.
Base class for performing redirection of call to symbol to another symbol in runtime.
virtual Error redirect(JITDylib &JD, const SymbolMap &NewDests)=0
Change the redirection destination of given symbols to new destination symbols.
virtual ~RedirectionManager()=default
Error redirect(JITDylib &JD, SymbolStringPtr Symbol, ExecutorSymbolDef NewDest)
Change the redirection destination of given symbol to new destination symbol.
Pointer to a pooled string representing a symbol name.
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.
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.