Skip to content

Commit 3dba4ca

Browse files
committed
[ORC][MachO] Remove the ExecutionSession& argument to MachOPlatform constructor.
We can get a reference to the ExecutionSession from the ObjectLinkingLayer argument, so there's no need to pass it in separately.
1 parent c198f77 commit 3dba4ca

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,7 @@ class MachOPlatform : public Platform {
292292

293293
static MachOExecutorSymbolFlags flagsForSymbol(jitlink::Symbol &Sym);
294294

295-
MachOPlatform(ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
296-
JITDylib &PlatformJD,
295+
MachOPlatform(ObjectLinkingLayer &ObjLinkingLayer, JITDylib &PlatformJD,
297296
std::unique_ptr<DefinitionGenerator> OrcRuntimeGenerator,
298297
HeaderOptions PlatformJDOpts,
299298
MachOHeaderMUBuilder BuildMachOHeaderMU, Error &Err);

llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ MachOPlatform::Create(ObjectLinkingLayer &ObjLinkingLayer, JITDylib &PlatformJD,
329329
// Create the instance.
330330
Error Err = Error::success();
331331
auto P = std::unique_ptr<MachOPlatform>(new MachOPlatform(
332-
ES, ObjLinkingLayer, PlatformJD, std::move(OrcRuntime),
332+
ObjLinkingLayer, PlatformJD, std::move(OrcRuntime),
333333
std::move(PlatformJDOpts), std::move(BuildMachOHeaderMU), Err));
334334
if (Err)
335335
return std::move(Err);
@@ -473,12 +473,12 @@ MachOPlatform::flagsForSymbol(jitlink::Symbol &Sym) {
473473
}
474474

475475
MachOPlatform::MachOPlatform(
476-
ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
477-
JITDylib &PlatformJD,
476+
ObjectLinkingLayer &ObjLinkingLayer, JITDylib &PlatformJD,
478477
std::unique_ptr<DefinitionGenerator> OrcRuntimeGenerator,
479478
HeaderOptions PlatformJDOpts, MachOHeaderMUBuilder BuildMachOHeaderMU,
480479
Error &Err)
481-
: ES(ES), PlatformJD(PlatformJD), ObjLinkingLayer(ObjLinkingLayer),
480+
: ES(ObjLinkingLayer.getExecutionSession()), PlatformJD(PlatformJD),
481+
ObjLinkingLayer(ObjLinkingLayer),
482482
BuildMachOHeaderMU(std::move(BuildMachOHeaderMU)) {
483483
ErrorAsOutParameter _(&Err);
484484
ObjLinkingLayer.addPlugin(std::make_unique<MachOPlatformPlugin>(*this));

0 commit comments

Comments
 (0)