@@ -159,11 +159,14 @@ class COFFHeaderMaterializationUnit : public MaterializationUnit {
159
159
namespace llvm {
160
160
namespace orc {
161
161
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 ();
167
170
168
171
// If the target is not supported then bail out immediately.
169
172
if (!supportedTarget (ES.getTargetTriple ()))
@@ -214,7 +217,7 @@ Expected<std::unique_ptr<COFFPlatform>> COFFPlatform::Create(
214
217
// Create the instance.
215
218
Error Err = Error::success ();
216
219
auto P = std::unique_ptr<COFFPlatform>(new COFFPlatform (
217
- ES, ObjLinkingLayer, PlatformJD, std::move (*OrcRuntimeArchiveGenerator),
220
+ ObjLinkingLayer, PlatformJD, std::move (*OrcRuntimeArchiveGenerator),
218
221
std::move (OrcRuntimeArchiveBuffer), std::move (RuntimeArchive),
219
222
std::move (LoadDynLibrary), StaticVCRuntime, VCRuntimePath, Err));
220
223
if (Err)
@@ -223,8 +226,8 @@ Expected<std::unique_ptr<COFFPlatform>> COFFPlatform::Create(
223
226
}
224
227
225
228
Expected<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,
228
231
LoadDynamicLibrary LoadDynLibrary, bool StaticVCRuntime,
229
232
const char *VCRuntimePath,
230
233
std::optional<SymbolAliasMap> RuntimeAliases) {
@@ -233,7 +236,7 @@ COFFPlatform::Create(ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
233
236
if (!ArchiveBuffer)
234
237
return createFileError (OrcRuntimePath, ArchiveBuffer.getError ());
235
238
236
- return Create (ES, ObjLinkingLayer, PlatformJD, std::move (*ArchiveBuffer),
239
+ return Create (ObjLinkingLayer, PlatformJD, std::move (*ArchiveBuffer),
237
240
std::move (LoadDynLibrary), StaticVCRuntime, VCRuntimePath,
238
241
std::move (RuntimeAliases));
239
242
}
@@ -382,14 +385,14 @@ bool COFFPlatform::supportedTarget(const Triple &TT) {
382
385
}
383
386
384
387
COFFPlatform::COFFPlatform (
385
- ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
386
- JITDylib &PlatformJD,
388
+ ObjectLinkingLayer &ObjLinkingLayer, JITDylib &PlatformJD,
387
389
std::unique_ptr<StaticLibraryDefinitionGenerator> OrcRuntimeGenerator,
388
390
std::unique_ptr<MemoryBuffer> OrcRuntimeArchiveBuffer,
389
391
std::unique_ptr<object::Archive> OrcRuntimeArchive,
390
392
LoadDynamicLibrary LoadDynLibrary, bool StaticVCRuntime,
391
393
const char *VCRuntimePath, Error &Err)
392
- : ES(ES), ObjLinkingLayer(ObjLinkingLayer),
394
+ : ES(ObjLinkingLayer.getExecutionSession()),
395
+ ObjLinkingLayer (ObjLinkingLayer),
393
396
LoadDynLibrary(std::move(LoadDynLibrary)),
394
397
OrcRuntimeArchiveBuffer(std::move(OrcRuntimeArchiveBuffer)),
395
398
OrcRuntimeArchive(std::move(OrcRuntimeArchive)),
0 commit comments