13#ifndef LLVM_EXECUTIONENGINE_ORC_LINKGRAPHLAYER_H
14#define LLVM_EXECUTIONENGINE_ORC_LINKGRAPHLAYER_H
42 return add(std::move(RT), std::move(
G), std::move(LGI));
58 virtual void emit(std::unique_ptr<MaterializationResponsibility> R,
59 std::unique_ptr<jitlink::LinkGraph>
G) = 0;
69 std::atomic<uint64_t> Counter{0};
76 std::unique_ptr<jitlink::LinkGraph> G,
81 std::unique_ptr<jitlink::LinkGraph> G)
87 void materialize(std::unique_ptr<MaterializationResponsibility> MR)
override {
88 LGLayer.
emit(std::move(MR), std::move(G));
95 std::unique_ptr<jitlink::LinkGraph> G;
99 std::unique_ptr<jitlink::LinkGraph>
G,
101 auto &JD = RT->getJITDylib();
103 return JD.define(std::make_unique<LinkGraphMaterializationUnit>(
104 *
this, std::move(
G), std::move(
I)),
Lightweight error class with error context and mandatory checking.
Flags for symbols in the JIT.
StringRef - Represent a constant reference to a string, i.e.
An ExecutionSession represents a running JIT program.
Represents a JIT'd dynamic library.
ResourceTrackerSP getDefaultResourceTracker()
Get the default resource tracker for this JITDylib.
LinkGraphLayer(ExecutionSession &ES)
ExecutionSession & getExecutionSession()
Error add(JITDylib &JD, std::unique_ptr< jitlink::LinkGraph > G, MaterializationUnit::Interface I)
Adds a LinkGraph to the given JITDylib.
virtual Error add(ResourceTrackerSP RT, std::unique_ptr< jitlink::LinkGraph > G, MaterializationUnit::Interface I)
Adds a LinkGraph to the JITDylib for the given ResourceTracker.
virtual void emit(std::unique_ptr< MaterializationResponsibility > R, std::unique_ptr< jitlink::LinkGraph > G)=0
Emit should materialize the given IR.
Error add(ResourceTrackerSP RT, std::unique_ptr< jitlink::LinkGraph > G)
Adds a LinkGraph to the JITDylib for the given ResourceTracker.
MaterializationUnit::Interface getInterface(jitlink::LinkGraph &G)
Get the interface for the given LinkGraph.
static JITSymbolFlags getJITSymbolFlagsForSymbol(jitlink::Symbol &Sym)
Get the JITSymbolFlags for the given symbol.
Error add(JITDylib &JD, std::unique_ptr< jitlink::LinkGraph > G)
Adds a LinkGraph to the given JITDylib.
virtual ~LinkGraphLayer()
MaterializationUnit for wrapping LinkGraphs.
StringRef getName() const override
Return the name of this materialization unit.
LinkGraphMaterializationUnit(LinkGraphLayer &LGLayer, std::unique_ptr< jitlink::LinkGraph > G)
void materialize(std::unique_ptr< MaterializationResponsibility > MR) override
Implementations of this method should materialize all symbols in the materialzation unit,...
LinkGraphMaterializationUnit(LinkGraphLayer &LGLayer, std::unique_ptr< jitlink::LinkGraph > G, Interface I)
A MaterializationUnit represents a set of symbol definitions that can be materialized as a group,...
Pointer to a pooled string representing a symbol name.
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.