llvm.org GIT mirror llvm / 0b8468c
[ORC] Replace the LLJIT/LLLazyJIT Create methods with Builder utilities. LLJITBuilder and LLLazyJITBuilder construct LLJIT and LLLazyJIT instances respectively. Over time these will allow more configurable options to be added while remaining easy to use in the default case, which for default in-process JITing is now: auto J = ExitOnErr(LLJITBuilder.create()); git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359511 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 1 year, 5 months ago
3 changed file(s) with 307 addition(s) and 166 deletion(s). Raw diff Collapse all Expand all
1919 #include "llvm/ExecutionEngine/Orc/IRTransformLayer.h"
2020 #include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
2121 #include "llvm/ExecutionEngine/Orc/ObjectTransformLayer.h"
22 #include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
2322 #include "llvm/ExecutionEngine/Orc/ThreadSafeModule.h"
2423 #include "llvm/Support/ThreadPool.h"
2524
2625 namespace llvm {
2726 namespace orc {
2827
28 class LLJITBuilderState;
29 class LLLazyJITBuilderState;
30
2931 /// A pre-fabricated ORC JIT stack that can serve as an alternative to MCJIT.
32 ///
33 /// Create instances using LLJITBuilder.
3034 class LLJIT {
31 public:
35 template friend class LLJITBuilderSetters;
36
37 public:
38 static Expected> Create(LLJITBuilderState &S);
3239
3340 /// Destruct this instance. If a multi-threaded instance, waits for all
3441 /// compile threads to complete.
3542 ~LLJIT();
3643
37 /// Create an LLJIT instance.
38 /// If NumCompileThreads is not equal to zero, creates a multi-threaded
39 /// LLJIT with the given number of compile threads.
40 static Expected>
41 Create(JITTargetMachineBuilder JTMB, DataLayout DL,
42 unsigned NumCompileThreads = 0);
43
4444 /// Returns the ExecutionSession for this instance.
4545 ExecutionSession &getExecutionSession() { return *ES; }
46
47 /// Returns a reference to the DataLayout for this instance.
48 const DataLayout &getDataLayout() const { return DL; }
4649
4750 /// Returns a reference to the JITDylib representing the JIT'd main program.
4851 JITDylib &getMainJITDylib() { return Main; }
102105 Error runDestructors() { return DtorRunner.run(); }
103106
104107 /// Returns a reference to the ObjLinkingLayer
105 RTDyldObjectLinkingLayer &getObjLinkingLayer() { return ObjLinkingLayer; }
108 ObjectLayer &getObjLinkingLayer() { return *ObjLinkingLayer; }
106109
107110 protected:
111 static std::unique_ptr
112 createObjectLinkingLayer(LLJITBuilderState &S, ExecutionSession &ES);
108113
109114 /// Create an LLJIT instance with a single compile thread.
110 LLJIT(std::unique_ptr ES, std::unique_ptr TM,
111 DataLayout DL);
112
113 /// Create an LLJIT instance with multiple compile threads.
114 LLJIT(std::unique_ptr ES, JITTargetMachineBuilder JTMB,
115 DataLayout DL, unsigned NumCompileThreads);
115 LLJIT(LLJITBuilderState &S, Error &Err);
116116
117117 std::string mangle(StringRef UnmangledName);
118118
126126 DataLayout DL;
127127 std::unique_ptr CompileThreads;
128128
129 RTDyldObjectLinkingLayer ObjLinkingLayer;
130 IRCompileLayer CompileLayer;
129 std::unique_ptr ObjLinkingLayer;
130 std::unique_ptr CompileLayer;
131131
132132 CtorDtorRunner CtorRunner, DtorRunner;
133133 };
135135 /// An extended version of LLJIT that supports lazy function-at-a-time
136136 /// compilation of LLVM IR.
137137 class LLLazyJIT : public LLJIT {
138 public:
139
140 /// Create an LLLazyJIT instance.
141 /// If NumCompileThreads is not equal to zero, creates a multi-threaded
142 /// LLLazyJIT with the given number of compile threads.
143 static Expected>
144 Create(JITTargetMachineBuilder JTMB, DataLayout DL,
145 JITTargetAddress ErrorAddr, unsigned NumCompileThreads = 0);
138 template friend class LLJITBuilderSetters;
139
140 public:
146141
147142 /// Set an IR transform (e.g. pass manager pipeline) to run on each function
148143 /// when it is compiled.
149144 void setLazyCompileTransform(IRTransformLayer::TransformFunction Transform) {
150 TransformLayer.setTransform(std::move(Transform));
145 TransformLayer->setTransform(std::move(Transform));
151146 }
152147
153148 /// Sets the partition function.
154149 void
155150 setPartitionFunction(CompileOnDemandLayer::PartitionFunction Partition) {
156 CODLayer.setPartitionFunction(std::move(Partition));
151 CODLayer->setPartitionFunction(std::move(Partition));
157152 }
158153
159154 /// Add a module to be lazily compiled to JITDylib JD.
167162 private:
168163
169164 // Create a single-threaded LLLazyJIT instance.
170 LLLazyJIT(std::unique_ptr ES,
171 std::unique_ptr TM, DataLayout DL,
172 std::unique_ptr LCTMgr,
173 std::function()> ISMBuilder);
174
175 // Create a multi-threaded LLLazyJIT instance.
176 LLLazyJIT(std::unique_ptr ES, JITTargetMachineBuilder JTMB,
177 DataLayout DL, unsigned NumCompileThreads,
178 std::unique_ptr LCTMgr,
179 std::function()> ISMBuilder);
165 LLLazyJIT(LLLazyJITBuilderState &S, Error &Err);
180166
181167 std::unique_ptr LCTMgr;
182 std::function()> ISMBuilder;
183
184 IRTransformLayer TransformLayer;
185 CompileOnDemandLayer CODLayer;
186 };
168 std::unique_ptr TransformLayer;
169 std::unique_ptr CODLayer;
170 };
171
172 class LLJITBuilderState {
173 public:
174 using CreateObjectLinkingLayerFunction =
175 std::function(ExecutionSession &)>;
176
177 std::unique_ptr ES;
178 Optional JTMB;
179 CreateObjectLinkingLayerFunction CreateObjectLinkingLayer;
180 unsigned NumCompileThreads = 0;
181
182 /// Called prior to JIT class construcion to fix up defaults.
183 Error prepareForConstruction();
184 };
185
186 template
187 class LLJITBuilderSetters {
188 public:
189 /// Set the JITTargetMachineBuilder for this instance.
190 ///
191 /// If this method is not called, JITTargetMachineBuilder::detectHost will be
192 /// used to construct a default target machine builder for the host platform.
193 SetterImpl &setJITTargetMachineBuilder(JITTargetMachineBuilder JTMB) {
194 impl().JTMB = std::move(JTMB);
195 return impl();
196 }
197
198 /// Return a reference to the JITTargetMachineBuilder.
199 ///
200 Optional &getJITTargetMachineBuilder() {
201 return impl().JTMB;
202 }
203
204 /// Set an ObjectLinkingLayer creation function.
205 ///
206 /// If this method is not called, a default creation function will be used
207 /// that will construct an RTDyldObjectLinkingLayer.
208 SetterImpl &setCreateObjectLinkingLayer(
209 LLJITBuilderState::CreateObjectLinkingLayerFunction
210 CreateObjectLinkingLayer) {
211 impl().CreateObjectLinkingLayer = std::move(CreateObjectLinkingLayer);
212 return impl();
213 }
214
215 /// Set the number of compile threads to use.
216 ///
217 /// If set to zero, compilation will be performed on the execution thread when
218 /// JITing in-process. If set to any other number N, a thread pool of N
219 /// threads will be created for compilation.
220 ///
221 /// If this method is not called, behavior will be as if it were called with
222 /// a zero argument.
223 SetterImpl &setNumCompileThreads(unsigned NumCompileThreads) {
224 impl().NumCompileThreads = NumCompileThreads;
225 return impl();
226 }
227
228 /// Create an instance of the JIT.
229 Expected> create() {
230 if (auto Err = impl().prepareForConstruction())
231 return std::move(Err);
232
233 Error Err = Error::success();
234 std::unique_ptr J(new JITType(impl(), Err));
235 if (Err)
236 return std::move(Err);
237 return std::move(J);
238 }
239
240 protected:
241 SetterImpl &impl() { return static_cast(*this); }
242 };
243
244 /// Constructs LLJIT instances.
245 class LLJITBuilder
246 : public LLJITBuilderState,
247 public LLJITBuilderSetters {};
248
249 class LLLazyJITBuilderState : public LLJITBuilderState {
250 friend class LLLazyJIT;
251
252 public:
253 using IndirectStubsManagerBuilderFunction =
254 std::function()>;
255
256 Triple TT;
257 JITTargetAddress LazyCompileFailureAddr = 0;
258 std::unique_ptr LCTMgr;
259 IndirectStubsManagerBuilderFunction ISMBuilder;
260
261 Error prepareForConstruction();
262 };
263
264 template
265 class LLLazyJITBuilderSetters
266 : public LLJITBuilderSetters {
267 public:
268 /// Set the address in the target address to call if a lazy compile fails.
269 ///
270 /// If this method is not called then the value will default to 0.
271 SetterImpl &setLazyCompileFailureAddr(JITTargetAddress Addr) {
272 this->impl().LazyCompileFailureAddr = Addr;
273 return this->impl();
274 }
275
276 /// Set the lazy-callthrough manager.
277 ///
278 /// If this method is not called then a default, in-process lazy callthrough
279 /// manager for the host platform will be used.
280 SetterImpl &
281 setLazyCallthroughManager(std::unique_ptr LCTMgr) {
282 this->impl().LCTMgr = std::move(LCTMgr);
283 return this->impl();
284 }
285
286 /// Set the IndirectStubsManager builder function.
287 ///
288 /// If this method is not called then a default, in-process
289 /// IndirectStubsManager builder for the host platform will be used.
290 SetterImpl &setIndirectStubsManagerBuilder(
291 LLLazyJITBuilderState::IndirectStubsManagerBuilderFunction ISMBuilder) {
292 this->impl().ISMBuilder = std::move(ISMBuilder);
293 return this->impl();
294 }
295 };
296
297 /// Constructs LLLazyJIT instances.
298 class LLLazyJITBuilder
299 : public LLLazyJITBuilderState,
300 public LLLazyJITBuilderSetters
301 LLLazyJITBuilderState> {};
187302
188303 } // End namespace orc
189304 } // End namespace llvm
77
88 #include "llvm/ExecutionEngine/Orc/LLJIT.h"
99 #include "llvm/ExecutionEngine/Orc/OrcError.h"
10 #include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
1011 #include "llvm/ExecutionEngine/SectionMemoryManager.h"
1112 #include "llvm/IR/Mangler.h"
1213
2829 namespace llvm {
2930 namespace orc {
3031
32 Error LLJITBuilderState::prepareForConstruction() {
33
34 if (!JTMB) {
35 if (auto JTMBOrErr = JITTargetMachineBuilder::detectHost())
36 JTMB = std::move(*JTMBOrErr);
37 else
38 return JTMBOrErr.takeError();
39 }
40
41 return Error::success();
42 }
43
3144 LLJIT::~LLJIT() {
3245 if (CompileThreads)
3346 CompileThreads->wait();
34 }
35
36 Expected>
37 LLJIT::Create(JITTargetMachineBuilder JTMB, DataLayout DL,
38 unsigned NumCompileThreads) {
39
40 if (NumCompileThreads == 0) {
41 // If NumCompileThreads == 0 then create a single-threaded LLJIT instance.
42 auto TM = JTMB.createTargetMachine();
43 if (!TM)
44 return TM.takeError();
45 return std::unique_ptr(new LLJIT(llvm::make_unique(),
46 std::move(*TM), std::move(DL)));
47 }
48
49 return std::unique_ptr(new LLJIT(llvm::make_unique(),
50 std::move(JTMB), std::move(DL),
51 NumCompileThreads));
5247 }
5348
5449 Error LLJIT::defineAbsolute(StringRef Name, JITEvaluatedSymbol Sym) {
6358 if (auto Err = applyDataLayout(*TSM.getModule()))
6459 return Err;
6560
66 return CompileLayer.add(JD, std::move(TSM), ES->allocateVModule());
61 return CompileLayer->add(JD, std::move(TSM), ES->allocateVModule());
6762 }
6863
6964 Error LLJIT::addObjectFile(JITDylib &JD, std::unique_ptr Obj) {
7065 assert(Obj && "Can not add null object");
7166
72 return ObjLinkingLayer.add(JD, std::move(Obj), ES->allocateVModule());
67 return ObjLinkingLayer->add(JD, std::move(Obj), ES->allocateVModule());
7368 }
7469
7570 Expected LLJIT::lookupLinkerMangled(JITDylib &JD,
7772 return ES->lookup(JITDylibSearchList({{&JD, true}}), ES->intern(Name));
7873 }
7974
80 LLJIT::LLJIT(std::unique_ptr ES,
81 std::unique_ptr TM, DataLayout DL)
82 : ES(std::move(ES)), Main(this->ES->getMainJITDylib()), DL(std::move(DL)),
83 ObjLinkingLayer(
84 *this->ES,
85 []() { return llvm::make_unique(); }),
86 CompileLayer(*this->ES, ObjLinkingLayer,
87 TMOwningSimpleCompiler(std::move(TM))),
88 CtorRunner(Main), DtorRunner(Main) {}
89
90 LLJIT::LLJIT(std::unique_ptr ES, JITTargetMachineBuilder JTMB,
91 DataLayout DL, unsigned NumCompileThreads)
92 : ES(std::move(ES)), Main(this->ES->getMainJITDylib()), DL(std::move(DL)),
93 ObjLinkingLayer(
94 *this->ES,
95 []() { return llvm::make_unique(); }),
96 CompileLayer(*this->ES, ObjLinkingLayer,
97 ConcurrentIRCompiler(std::move(JTMB))),
98 CtorRunner(Main), DtorRunner(Main) {
99 assert(NumCompileThreads != 0 &&
100 "Multithreaded LLJIT instance can not be created with 0 threads");
101
102 // Move modules to new contexts when they're emitted so that we can compile
103 // them in parallel.
104 CompileLayer.setCloneToNewContextOnEmit(true);
105
106 // Create a thread pool to compile on and set the execution session
107 // dispatcher to use the thread pool.
108 CompileThreads = llvm::make_unique(NumCompileThreads);
109 this->ES->setDispatchMaterialization(
110 [this](JITDylib &JD, std::unique_ptr MU) {
111 // FIXME: Switch to move capture once we have c++14.
112 auto SharedMU = std::shared_ptr(std::move(MU));
113 auto Work = [SharedMU, &JD]() { SharedMU->doMaterialize(JD); };
114 CompileThreads->async(std::move(Work));
115 });
75 std::unique_ptr
76 LLJIT::createObjectLinkingLayer(LLJITBuilderState &S, ExecutionSession &ES) {
77
78 // If the config state provided an ObjectLinkingLayer factory then use it.
79 if (S.CreateObjectLinkingLayer)
80 return S.CreateObjectLinkingLayer(ES);
81
82 // Otherwise default to creating an RTDyldObjectLinkingLayer that constructs
83 // a new SectionMemoryManager for each object.
84 auto GetMemMgr = []() { return llvm::make_unique(); };
85 return llvm::make_unique(ES, std::move(GetMemMgr));
86 }
87
88 LLJIT::LLJIT(LLJITBuilderState &S, Error &Err)
89 : ES(S.ES ? std::move(S.ES) : llvm::make_unique()),
90 Main(this->ES->getMainJITDylib()), DL(""), CtorRunner(Main),
91 DtorRunner(Main) {
92
93 ErrorAsOutParameter _(&Err);
94
95 ObjLinkingLayer = createObjectLinkingLayer(S, *ES);
96
97 if (S.NumCompileThreads > 0) {
98
99 // Configure multi-threaded.
100
101 if (auto DLOrErr = S.JTMB->getDefaultDataLayoutForTarget())
102 DL = std::move(*DLOrErr);
103 else {
104 Err = DLOrErr.takeError();
105 return;
106 }
107
108 {
109 auto TmpCompileLayer = llvm::make_unique(
110 *ES, *ObjLinkingLayer, ConcurrentIRCompiler(std::move(*S.JTMB)));
111
112 TmpCompileLayer->setCloneToNewContextOnEmit(true);
113 CompileLayer = std::move(TmpCompileLayer);
114 }
115
116 CompileThreads = llvm::make_unique(S.NumCompileThreads);
117 ES->setDispatchMaterialization(
118 [this](JITDylib &JD, std::unique_ptr MU) {
119 // FIXME: Switch to move capture once we have c++14.
120 auto SharedMU = std::shared_ptr(std::move(MU));
121 auto Work = [SharedMU, &JD]() { SharedMU->doMaterialize(JD); };
122 CompileThreads->async(std::move(Work));
123 });
124 } else {
125
126 // Configure single-threaded.
127
128 auto TM = S.JTMB->createTargetMachine();
129 if (!TM) {
130 Err = TM.takeError();
131 return;
132 }
133
134 DL = (*TM)->createDataLayout();
135
136 CompileLayer = llvm::make_unique(
137 *ES, *ObjLinkingLayer, TMOwningSimpleCompiler(std::move(*TM)));
138 }
116139 }
117140
118141 std::string LLJIT::mangle(StringRef UnmangledName) {
141164 DtorRunner.add(getDestructors(M));
142165 }
143166
144 Expected>
145 LLLazyJIT::Create(JITTargetMachineBuilder JTMB, DataLayout DL,
146 JITTargetAddress ErrorAddr, unsigned NumCompileThreads) {
147 auto ES = llvm::make_unique();
148
149 const Triple &TT = JTMB.getTargetTriple();
150
151 auto LCTMgr = createLocalLazyCallThroughManager(TT, *ES, ErrorAddr);
152 if (!LCTMgr)
153 return LCTMgr.takeError();
154
155 auto ISMBuilder = createLocalIndirectStubsManagerBuilder(TT);
156 if (!ISMBuilder)
157 return make_error(
158 std::string("No indirect stubs manager builder for ") + TT.str(),
159 inconvertibleErrorCode());
160
161 if (NumCompileThreads == 0) {
162 auto TM = JTMB.createTargetMachine();
163 if (!TM)
164 return TM.takeError();
165 return std::unique_ptr(
166 new LLLazyJIT(std::move(ES), std::move(*TM), std::move(DL),
167 std::move(*LCTMgr), std::move(ISMBuilder)));
168 }
169
170 return std::unique_ptr(new LLLazyJIT(
171 std::move(ES), std::move(JTMB), std::move(DL), NumCompileThreads,
172 std::move(*LCTMgr), std::move(ISMBuilder)));
167 Error LLLazyJITBuilderState::prepareForConstruction() {
168 if (auto Err = LLJITBuilderState::prepareForConstruction())
169 return Err;
170 TT = JTMB->getTargetTriple();
171 return Error::success();
173172 }
174173
175174 Error LLLazyJIT::addLazyIRModule(JITDylib &JD, ThreadSafeModule TSM) {
180179
181180 recordCtorDtors(*TSM.getModule());
182181
183 return CODLayer.add(JD, std::move(TSM), ES->allocateVModule());
184 }
185
186 LLLazyJIT::LLLazyJIT(
187 std::unique_ptr ES, std::unique_ptr TM,
188 DataLayout DL, std::unique_ptr LCTMgr,
189 std::function()> ISMBuilder)
190 : LLJIT(std::move(ES), std::move(TM), std::move(DL)),
191 LCTMgr(std::move(LCTMgr)), TransformLayer(*this->ES, CompileLayer),
192 CODLayer(*this->ES, TransformLayer, *this->LCTMgr,
193 std::move(ISMBuilder)) {}
194
195 LLLazyJIT::LLLazyJIT(
196 std::unique_ptr ES, JITTargetMachineBuilder JTMB,
197 DataLayout DL, unsigned NumCompileThreads,
198 std::unique_ptr LCTMgr,
199 std::function()> ISMBuilder)
200 : LLJIT(std::move(ES), std::move(JTMB), std::move(DL), NumCompileThreads),
201 LCTMgr(std::move(LCTMgr)), TransformLayer(*this->ES, CompileLayer),
202 CODLayer(*this->ES, TransformLayer, *this->LCTMgr,
203 std::move(ISMBuilder)) {
204 CODLayer.setCloneToNewContextOnEmit(true);
182 return CODLayer->add(JD, std::move(TSM), ES->allocateVModule());
183 }
184
185 LLLazyJIT::LLLazyJIT(LLLazyJITBuilderState &S, Error &Err) : LLJIT(S, Err) {
186
187 // If LLJIT construction failed then bail out.
188 if (Err)
189 return;
190
191 ErrorAsOutParameter _(&Err);
192
193 /// Take/Create the lazy-compile callthrough manager.
194 if (S.LCTMgr)
195 LCTMgr = std::move(S.LCTMgr);
196 else {
197 if (auto LCTMgrOrErr = createLocalLazyCallThroughManager(
198 S.TT, *ES, S.LazyCompileFailureAddr))
199 LCTMgr = std::move(*LCTMgrOrErr);
200 else {
201 Err = LCTMgrOrErr.takeError();
202 return;
203 }
204 }
205
206 // Take/Create the indirect stubs manager builder.
207 auto ISMBuilder = std::move(S.ISMBuilder);
208
209 // If none was provided, try to build one.
210 if (!ISMBuilder)
211 ISMBuilder = createLocalIndirectStubsManagerBuilder(S.TT);
212
213 // No luck. Bail out.
214 if (!ISMBuilder) {
215 Err = make_error("Could not construct "
216 "IndirectStubsManagerBuilder for target " +
217 S.TT.str(),
218 inconvertibleErrorCode());
219 return;
220 }
221
222 // Create the transform layer.
223 TransformLayer = llvm::make_unique(*ES, *CompileLayer);
224
225 // Create the COD layer.
226 CODLayer = llvm::make_unique(
227 *ES, *TransformLayer, *LCTMgr, std::move(ISMBuilder));
228
229 if (S.NumCompileThreads > 0)
230 CODLayer->setCloneToNewContextOnEmit(true);
205231 }
206232
207233 } // End namespace orc.
762762 reportError(Err, ProgName);
763763
764764 const auto &TT = MainModule.getModule()->getTargetTriple();
765 orc::JITTargetMachineBuilder JTMB =
765 orc::LLLazyJITBuilder Builder;
766
767 Builder.setJITTargetMachineBuilder(
766768 TT.empty() ? ExitOnErr(orc::JITTargetMachineBuilder::detectHost())
767 : orc::JITTargetMachineBuilder(Triple(TT));
769 : orc::JITTargetMachineBuilder(Triple(TT)));
768770
769771 if (!MArch.empty())
770 JTMB.getTargetTriple().setArchName(MArch);
771
772 JTMB.setCPU(getCPUStr())
772 Builder.getJITTargetMachineBuilder()->getTargetTriple().setArchName(MArch);
773
774 Builder.getJITTargetMachineBuilder()
775 ->setCPU(getCPUStr())
773776 .addFeatures(getFeatureList())
774777 .setRelocationModel(RelocModel.getNumOccurrences()
775778 ? Optional(RelocModel)
778781 ? Optional(CMModel)
779782 : None);
780783
781 DataLayout DL = ExitOnErr(JTMB.getDefaultDataLayoutForTarget());
782
783 auto J = ExitOnErr(orc::LLLazyJIT::Create(
784 std::move(JTMB), DL,
785 pointerToJITTargetAddress(exitOnLazyCallThroughFailure),
786 LazyJITCompileThreads));
784 Builder.setLazyCompileFailureAddr(
785 pointerToJITTargetAddress(exitOnLazyCallThroughFailure));
786 Builder.setNumCompileThreads(LazyJITCompileThreads);
787
788 auto J = ExitOnErr(Builder.create());
787789
788790 if (PerModuleLazy)
789791 J->setPartitionFunction(orc::CompileOnDemandLayer::compileWholeModule);
800802 });
801803 J->getMainJITDylib().setGenerator(
802804 ExitOnErr(orc::DynamicLibrarySearchGenerator::GetForCurrentProcess(
803 DL.getGlobalPrefix())));
804
805 orc::MangleAndInterner Mangle(J->getExecutionSession(), DL);
805 J->getDataLayout().getGlobalPrefix())));
806
807 orc::MangleAndInterner Mangle(J->getExecutionSession(), J->getDataLayout());
806808 orc::LocalCXXRuntimeOverrides CXXRuntimeOverrides;
807809 ExitOnErr(CXXRuntimeOverrides.enable(J->getMainJITDylib(), Mangle));
808810
861863 reinterpret_cast(static_cast(EntryPointSym.getAddress()));
862864 AltEntryThreads.push_back(std::thread([EntryPoint]() { EntryPoint(); }));
863865 }
864
865 J->getExecutionSession().dump(llvm::dbgs());
866866
867867 // Run main.
868868 auto MainSym = ExitOnErr(J->lookup("main"));