13#ifndef LLVM_EXECUTIONENGINE_ORC_LINKGRAPHLAYER_H
14#define LLVM_EXECUTIONENGINE_ORC_LINKGRAPHLAYER_H
42 auto LGI = getInterface(*
G);
43 return add(std::move(RT), std::move(
G), std::move(LGI));
59 virtual void emit(std::unique_ptr<MaterializationResponsibility> R,
60 std::unique_ptr<jitlink::LinkGraph>
G) = 0;
70 std::atomic<uint64_t> Counter{0};
77 std::unique_ptr<jitlink::LinkGraph>
G,
82 std::unique_ptr<jitlink::LinkGraph>
G)
88 void materialize(std::unique_ptr<MaterializationResponsibility> MR)
override {
89 LGLayer.emit(std::move(MR), std::move(
G));
96 std::unique_ptr<jitlink::LinkGraph>
G;
100 std::unique_ptr<jitlink::LinkGraph>
G,
102 auto &JD = RT->getJITDylib();
104 return JD.define(std::make_unique<LinkGraphMaterializationUnit>(
105 *
this, std::move(
G), std::move(
I)),
static StringRef getName(Value *V)
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.
LLVM_ABI 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.
Error add(JITDylib &JD, std::unique_ptr< jitlink::LinkGraph > G)
Adds a LinkGraph to the given JITDylib.
virtual ~LinkGraphLayer()
MaterializationUnit for wrapping LinkGraphs.
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.