@@ -233,10 +233,13 @@ class DSOHandleMaterializationUnit : public MaterializationUnit {
233233namespace llvm {
234234namespace orc {
235235
236- Expected<std::unique_ptr<ELFNixPlatform>> ELFNixPlatform::Create (
237- ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
238- JITDylib &PlatformJD, std::unique_ptr<DefinitionGenerator> OrcRuntime,
239- std::optional<SymbolAliasMap> RuntimeAliases) {
236+ Expected<std::unique_ptr<ELFNixPlatform>>
237+ ELFNixPlatform::Create (ObjectLinkingLayer &ObjLinkingLayer,
238+ JITDylib &PlatformJD,
239+ std::unique_ptr<DefinitionGenerator> OrcRuntime,
240+ std::optional<SymbolAliasMap> RuntimeAliases) {
241+
242+ auto &ES = ObjLinkingLayer.getExecutionSession ();
240243
241244 // If the target is not supported then bail out immediately.
242245 if (!supportedTarget (ES.getTargetTriple ()))
@@ -271,15 +274,14 @@ Expected<std::unique_ptr<ELFNixPlatform>> ELFNixPlatform::Create(
271274 // Create the instance.
272275 Error Err = Error::success ();
273276 auto P = std::unique_ptr<ELFNixPlatform>(new ELFNixPlatform (
274- ES, ObjLinkingLayer, PlatformJD, std::move (OrcRuntime), Err));
277+ ObjLinkingLayer, PlatformJD, std::move (OrcRuntime), Err));
275278 if (Err)
276279 return std::move (Err);
277280 return std::move (P);
278281}
279282
280283Expected<std::unique_ptr<ELFNixPlatform>>
281- ELFNixPlatform::Create (ExecutionSession &ES,
282- ObjectLinkingLayer &ObjLinkingLayer,
284+ ELFNixPlatform::Create (ObjectLinkingLayer &ObjLinkingLayer,
283285 JITDylib &PlatformJD, const char *OrcRuntimePath,
284286 std::optional<SymbolAliasMap> RuntimeAliases) {
285287
@@ -289,7 +291,7 @@ ELFNixPlatform::Create(ExecutionSession &ES,
289291 if (!OrcRuntimeArchiveGenerator)
290292 return OrcRuntimeArchiveGenerator.takeError ();
291293
292- return Create (ES, ObjLinkingLayer, PlatformJD,
294+ return Create (ObjLinkingLayer, PlatformJD,
293295 std::move (*OrcRuntimeArchiveGenerator),
294296 std::move (RuntimeAliases));
295297}
@@ -392,10 +394,10 @@ bool ELFNixPlatform::supportedTarget(const Triple &TT) {
392394}
393395
394396ELFNixPlatform::ELFNixPlatform (
395- ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
396- JITDylib &PlatformJD,
397+ ObjectLinkingLayer &ObjLinkingLayer, JITDylib &PlatformJD,
397398 std::unique_ptr<DefinitionGenerator> OrcRuntimeGenerator, Error &Err)
398- : ES(ES), PlatformJD(PlatformJD), ObjLinkingLayer(ObjLinkingLayer),
399+ : ES(ObjLinkingLayer.getExecutionSession()), PlatformJD(PlatformJD),
400+ ObjLinkingLayer (ObjLinkingLayer),
399401 DSOHandleSymbol(ES.intern(" __dso_handle" )) {
400402 ErrorAsOutParameter _ (&Err);
401403 ObjLinkingLayer.addPlugin (std::make_unique<ELFNixPlatformPlugin>(*this ));
0 commit comments