LLVM: include/llvm/ExecutionEngine/Orc/LinkGraphLayer.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_EXECUTIONENGINE_ORC_LINKGRAPHLAYER_H
14#define LLVM_EXECUTIONENGINE_ORC_LINKGRAPHLAYER_H
15
21
22#include
23#include
24
26
28public:
30
32
34
35
38
39
40
43 return add(std::move(RT), std::move(G), std::move(LGI));
44 }
45
46
51
52
53
57
58
59 virtual void emit(std::unique_ptr R,
60 std::unique_ptrjitlink::LinkGraph G) = 0;
61
62
64
65
67
68private:
70 std::atomic<uint64_t> Counter{0};
71};
72
73
75public:
77 std::unique_ptrjitlink::LinkGraph G,
80
82 std::unique_ptrjitlink::LinkGraph G)
85
87
88 void materialize(std::unique_ptr MR) override {
89 LGLayer.emit(std::move(MR), std::move(G));
90 }
91
92private:
94
96 std::unique_ptrjitlink::LinkGraph G;
97};
98
100 std::unique_ptrjitlink::LinkGraph G,
102 auto &JD = RT->getJITDylib();
103
104 return JD.define(std::make_unique(
105 *this, std::move(G), std::move(I)),
106 std::move(RT));
107}
108
109}
110
111#endif
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.
Definition LinkGraphLayer.h:27
LinkGraphLayer(ExecutionSession &ES)
Definition LinkGraphLayer.h:29
ExecutionSession & getExecutionSession()
Definition LinkGraphLayer.h:33
Error add(JITDylib &JD, std::unique_ptr< jitlink::LinkGraph > G, MaterializationUnit::Interface I)
Adds a LinkGraph to the given JITDylib.
Definition LinkGraphLayer.h:47
virtual Error add(ResourceTrackerSP RT, std::unique_ptr< jitlink::LinkGraph > G, MaterializationUnit::Interface I)
Adds a LinkGraph to the JITDylib for the given ResourceTracker.
Definition LinkGraphLayer.h:99
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.
Definition LinkGraphLayer.h:41
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.
Definition LinkGraphLayer.h:54
virtual ~LinkGraphLayer()
LinkGraphMaterializationUnit(LinkGraphLayer &LGLayer, std::unique_ptr< jitlink::LinkGraph > G)
Definition LinkGraphLayer.h:81
void materialize(std::unique_ptr< MaterializationResponsibility > MR) override
Implementations of this method should materialize all symbols in the materialzation unit,...
Definition LinkGraphLayer.h:88
LinkGraphMaterializationUnit(LinkGraphLayer &LGLayer, std::unique_ptr< jitlink::LinkGraph > G, Interface I)
Definition LinkGraphLayer.h:76
MaterializationUnit(Interface I)
Pointer to a pooled string representing a symbol name.
IntrusiveRefCntPtr< ResourceTracker > ResourceTrackerSP
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.