@@ -159,11 +159,14 @@ class COFFHeaderMaterializationUnit : public MaterializationUnit {
159159namespace llvm {
160160namespace orc {
161161
162- Expected<std::unique_ptr<COFFPlatform>> COFFPlatform::Create (
163- ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
164- JITDylib &PlatformJD, std::unique_ptr<MemoryBuffer> OrcRuntimeArchiveBuffer,
165- LoadDynamicLibrary LoadDynLibrary, bool StaticVCRuntime,
166- const char *VCRuntimePath, std::optional<SymbolAliasMap> RuntimeAliases) {
162+ Expected<std::unique_ptr<COFFPlatform>>
163+ COFFPlatform::Create (ObjectLinkingLayer &ObjLinkingLayer, JITDylib &PlatformJD,
164+ std::unique_ptr<MemoryBuffer> OrcRuntimeArchiveBuffer,
165+ LoadDynamicLibrary LoadDynLibrary, bool StaticVCRuntime,
166+ const char *VCRuntimePath,
167+ std::optional<SymbolAliasMap> RuntimeAliases) {
168+
169+ auto &ES = ObjLinkingLayer.getExecutionSession ();
167170
168171 // If the target is not supported then bail out immediately.
169172 if (!supportedTarget (ES.getTargetTriple ()))
@@ -214,7 +217,7 @@ Expected<std::unique_ptr<COFFPlatform>> COFFPlatform::Create(
214217 // Create the instance.
215218 Error Err = Error::success ();
216219 auto P = std::unique_ptr<COFFPlatform>(new COFFPlatform (
217- ES, ObjLinkingLayer, PlatformJD, std::move (*OrcRuntimeArchiveGenerator),
220+ ObjLinkingLayer, PlatformJD, std::move (*OrcRuntimeArchiveGenerator),
218221 std::move (OrcRuntimeArchiveBuffer), std::move (RuntimeArchive),
219222 std::move (LoadDynLibrary), StaticVCRuntime, VCRuntimePath, Err));
220223 if (Err)
@@ -223,8 +226,8 @@ Expected<std::unique_ptr<COFFPlatform>> COFFPlatform::Create(
223226}
224227
225228Expected<std::unique_ptr<COFFPlatform>>
226- COFFPlatform::Create (ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer ,
227- JITDylib &PlatformJD, const char *OrcRuntimePath,
229+ COFFPlatform::Create (ObjectLinkingLayer &ObjLinkingLayer, JITDylib &PlatformJD ,
230+ const char *OrcRuntimePath,
228231 LoadDynamicLibrary LoadDynLibrary, bool StaticVCRuntime,
229232 const char *VCRuntimePath,
230233 std::optional<SymbolAliasMap> RuntimeAliases) {
@@ -233,7 +236,7 @@ COFFPlatform::Create(ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
233236 if (!ArchiveBuffer)
234237 return createFileError (OrcRuntimePath, ArchiveBuffer.getError ());
235238
236- return Create (ES, ObjLinkingLayer, PlatformJD, std::move (*ArchiveBuffer),
239+ return Create (ObjLinkingLayer, PlatformJD, std::move (*ArchiveBuffer),
237240 std::move (LoadDynLibrary), StaticVCRuntime, VCRuntimePath,
238241 std::move (RuntimeAliases));
239242}
@@ -382,14 +385,14 @@ bool COFFPlatform::supportedTarget(const Triple &TT) {
382385}
383386
384387COFFPlatform::COFFPlatform (
385- ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
386- JITDylib &PlatformJD,
388+ ObjectLinkingLayer &ObjLinkingLayer, JITDylib &PlatformJD,
387389 std::unique_ptr<StaticLibraryDefinitionGenerator> OrcRuntimeGenerator,
388390 std::unique_ptr<MemoryBuffer> OrcRuntimeArchiveBuffer,
389391 std::unique_ptr<object::Archive> OrcRuntimeArchive,
390392 LoadDynamicLibrary LoadDynLibrary, bool StaticVCRuntime,
391393 const char *VCRuntimePath, Error &Err)
392- : ES(ES), ObjLinkingLayer(ObjLinkingLayer),
394+ : ES(ObjLinkingLayer.getExecutionSession()),
395+ ObjLinkingLayer (ObjLinkingLayer),
393396 LoadDynLibrary(std::move(LoadDynLibrary)),
394397 OrcRuntimeArchiveBuffer(std::move(OrcRuntimeArchiveBuffer)),
395398 OrcRuntimeArchive(std::move(OrcRuntimeArchive)),
0 commit comments