@@ -387,37 +387,36 @@ class TargetReflectionContext
387
387
} // namespace
388
388
389
389
std::unique_ptr<SwiftLanguageRuntimeImpl::ReflectionContextInterface>
390
- SwiftLanguageRuntimeImpl::ReflectionContextInterface::CreateReflectionContext32 (
391
- std::shared_ptr<swift::remote::MemoryReader> reader, bool ObjCInterop ,
392
- SwiftMetadataCache *swift_metadata_cache) {
390
+ SwiftLanguageRuntimeImpl::ReflectionContextInterface::CreateReflectionContext (
391
+ uint8_t ptr_size, std::shared_ptr<swift::remote::MemoryReader> reader,
392
+ bool ObjCInterop, SwiftMetadataCache *swift_metadata_cache) {
393
393
using ReflectionContext32ObjCInterop =
394
394
TargetReflectionContext<swift::reflection::ReflectionContext<
395
395
swift::External<swift::WithObjCInterop<swift::RuntimeTarget<4 >>>>>;
396
396
using ReflectionContext32NoObjCInterop =
397
397
TargetReflectionContext<swift::reflection::ReflectionContext<
398
398
swift::External<swift::NoObjCInterop<swift::RuntimeTarget<4 >>>>>;
399
- if (ObjCInterop)
400
- return std::make_unique<ReflectionContext32ObjCInterop>(
401
- reader, swift_metadata_cache);
402
- return std::make_unique<ReflectionContext32NoObjCInterop>(
403
- reader, swift_metadata_cache);
404
- }
405
-
406
- std::unique_ptr<SwiftLanguageRuntimeImpl::ReflectionContextInterface>
407
- SwiftLanguageRuntimeImpl::ReflectionContextInterface::CreateReflectionContext64 (
408
- std::shared_ptr<swift::remote::MemoryReader> reader, bool ObjCInterop,
409
- SwiftMetadataCache *swift_metadata_cache) {
410
399
using ReflectionContext64ObjCInterop =
411
400
TargetReflectionContext<swift::reflection::ReflectionContext<
412
401
swift::External<swift::WithObjCInterop<swift::RuntimeTarget<8 >>>>>;
413
402
using ReflectionContext64NoObjCInterop =
414
403
TargetReflectionContext<swift::reflection::ReflectionContext<
415
404
swift::External<swift::NoObjCInterop<swift::RuntimeTarget<8 >>>>>;
416
- if (ObjCInterop)
417
- return std::make_unique<ReflectionContext64ObjCInterop>(
405
+ if (ptr_size == 4 ) {
406
+ if (ObjCInterop)
407
+ return std::make_unique<ReflectionContext32ObjCInterop>(
408
+ reader, swift_metadata_cache);
409
+ return std::make_unique<ReflectionContext32NoObjCInterop>(
418
410
reader, swift_metadata_cache);
419
- return std::make_unique<ReflectionContext64NoObjCInterop>(
420
- reader, swift_metadata_cache);
411
+ }
412
+ if (ptr_size == 8 ) {
413
+ if (ObjCInterop)
414
+ return std::make_unique<ReflectionContext64ObjCInterop>(
415
+ reader, swift_metadata_cache);
416
+ return std::make_unique<ReflectionContext64NoObjCInterop>(
417
+ reader, swift_metadata_cache);
418
+ }
419
+ return {};
421
420
}
422
421
423
422
SwiftLanguageRuntimeImpl::ReflectionContextInterface::
0 commit comments