LLVM: include/llvm/ExecutionEngine/Orc/Layer.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_EXECUTIONENGINE_ORC_LAYER_H
14#define LLVM_EXECUTIONENGINE_ORC_LAYER_H
15
24
25namespace llvm {
26namespace orc {
27
28
29
30
31
33public:
35
36
37
41
42
43
44
45
46
49
50
52
53
55
56protected:
59
60private:
63
65};
66
67
69public:
72
74
75
77
78
82
83
84
85
86
87
88
89
90
91
93 this->CloneToNewContextOnEmit = CloneToNewContextOnEmit;
94 }
95
96
98
99
100
102
103
104
108
109
110 virtual void emit(std::unique_ptr R,
112
113private:
114 bool CloneToNewContextOnEmit = false;
117};
118
119
120
122public:
126
127private:
128 void materialize(std::unique_ptr R) override;
129
131};
132
133
135public:
137
140
141
143
144
145
148
149
150
151
153
154
155
160
161
162
163
164 Error add(JITDylib &JD, std::unique_ptr O);
165
166
167 virtual void emit(std::unique_ptr R,
168 std::unique_ptr O) = 0;
169
170private:
172};
173
174
175
178public:
179
182
184 std::unique_ptr O,
186
187
189
190private:
191 void materialize(std::unique_ptr R) override;
193
195 std::unique_ptr O;
196};
197
198}
199}
200
201#endif
Module.h This file contains the declarations for the Module class.
static StringRef getName(Value *V)
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
Inheritance utility for extensible RTTI.
StringRef - Represent a constant reference to a string, i.e.
BasicIRLayerMaterializationUnit(IRLayer &L, const IRSymbolMapper::ManglingOptions &MO, ThreadSafeModule TSM)
static Expected< std::unique_ptr< BasicObjectLayerMaterializationUnit > > Create(ObjectLayer &L, std::unique_ptr< MemoryBuffer > O)
Create using the default object interface builder function.
BasicObjectLayerMaterializationUnit(ObjectLayer &L, std::unique_ptr< MemoryBuffer > O, Interface I)
An ExecutionSession represents a running JIT program.
Interface for layers that accept LLVM IR.
Definition Layer.h:68
IRLayer(ExecutionSession &ES, const IRSymbolMapper::ManglingOptions *&MO)
Definition Layer.h:70
virtual void emit(std::unique_ptr< MaterializationResponsibility > R, ThreadSafeModule TSM)=0
Emit should materialize the given IR.
virtual Error add(ResourceTrackerSP RT, ThreadSafeModule TSM)
Add a MaterializatinoUnit representing the given IR to the JITDylib targeted by the given tracker.
ExecutionSession & getExecutionSession()
Returns the ExecutionSession for this layer.
Definition Layer.h:76
void setCloneToNewContextOnEmit(bool CloneToNewContextOnEmit)
Sets the CloneToNewContextOnEmit flag (false by default).
Definition Layer.h:92
Error add(JITDylib &JD, ThreadSafeModule TSM)
Adds a MaterializationUnit representing the given IR to the given JITDylib.
Definition Layer.h:105
const IRSymbolMapper::ManglingOptions *& getManglingOptions() const
Get the mangling options for this layer.
Definition Layer.h:79
bool getCloneToNewContextOnEmit() const
Returns the current value of the CloneToNewContextOnEmit flag.
Definition Layer.h:97
SymbolNameToDefinitionMap SymbolToDefinition
Definition Layer.h:58
const ThreadSafeModule & getModule() const
Return a reference to the contained ThreadSafeModule.
Definition Layer.h:54
IRMaterializationUnit(ExecutionSession &ES, const IRSymbolMapper::ManglingOptions &MO, ThreadSafeModule TSM)
Create an IRMaterializationLayer.
ThreadSafeModule TSM
Definition Layer.h:57
std::map< SymbolStringPtr, GlobalValue * > SymbolNameToDefinitionMap
Definition Layer.h:34
Represents a JIT'd dynamic library.
LLVM_ABI ResourceTrackerSP getDefaultResourceTracker()
Get the default resource tracker for this JITDylib.
MaterializationUnit(Interface I)
friend class ExecutionSession
Interface for Layers that accept object files.
Definition Layer.h:134
ObjectLayer(ExecutionSession &ES)
Error add(JITDylib &JD, std::unique_ptr< MemoryBuffer > O, MaterializationUnit::Interface I)
Adds a MaterializationUnit for the object file in the given memory buffer to the given JITDylib.
Definition Layer.h:156
virtual void emit(std::unique_ptr< MaterializationResponsibility > R, std::unique_ptr< MemoryBuffer > O)=0
Emit should materialize the given IR.
static char ID
Definition Layer.h:136
virtual Error add(ResourceTrackerSP RT, std::unique_ptr< MemoryBuffer > O, MaterializationUnit::Interface I)
Adds a MaterializationUnit for the object file in the given memory buffer to the JITDylib for the giv...
ExecutionSession & getExecutionSession()
Returns the execution session for this layer.
Definition Layer.h:142
Pointer to a pooled string representing a symbol name.
An LLVM Module together with a shared ThreadSafeContext.
IntrusiveRefCntPtr< ResourceTracker > ResourceTrackerSP
This is an optimization pass for GlobalISel generic memory operations.