@@ -231,12 +231,10 @@ namespace {
231
231
232
232
// / An implementation of the generic ReflectionContextInterface that
233
233
// / is templatized on target pointer width and specialized to either
234
- // / 32-bit or 64-bit pointers.
235
- template <unsigned PointerSize >
234
+ // / 32-bit or 64-bit pointers, with and without ObjC interoperability .
235
+ template <typename ReflectionContext >
236
236
class TargetReflectionContext
237
237
: public SwiftLanguageRuntimeImpl::ReflectionContextInterface {
238
- using ReflectionContext = swift::reflection::ReflectionContext<
239
- swift::External<swift::RuntimeTarget<PointerSize>>>;
240
238
ReflectionContext m_reflection_ctx;
241
239
242
240
public:
@@ -350,14 +348,30 @@ class TargetReflectionContext
350
348
351
349
std::unique_ptr<SwiftLanguageRuntimeImpl::ReflectionContextInterface>
352
350
SwiftLanguageRuntimeImpl::ReflectionContextInterface::CreateReflectionContext32 (
353
- std::shared_ptr<swift::remote::MemoryReader> reader) {
354
- return std::make_unique<TargetReflectionContext<4 >>(reader);
351
+ std::shared_ptr<swift::remote::MemoryReader> reader, bool ObjCInterop) {
352
+ using ReflectionContext32ObjCInterop =
353
+ TargetReflectionContext<swift::reflection::ReflectionContext<
354
+ swift::External<swift::WithObjCInterop<swift::RuntimeTarget<4 >>>>>;
355
+ using ReflectionContext32NoObjCInterop =
356
+ TargetReflectionContext<swift::reflection::ReflectionContext<
357
+ swift::External<swift::NoObjCInterop<swift::RuntimeTarget<4 >>>>>;
358
+ if (ObjCInterop)
359
+ return std::make_unique<ReflectionContext32ObjCInterop>(reader);
360
+ return std::make_unique<ReflectionContext32NoObjCInterop>(reader);
355
361
}
356
362
357
363
std::unique_ptr<SwiftLanguageRuntimeImpl::ReflectionContextInterface>
358
364
SwiftLanguageRuntimeImpl::ReflectionContextInterface::CreateReflectionContext64 (
359
- std::shared_ptr<swift::remote::MemoryReader> reader) {
360
- return std::make_unique<TargetReflectionContext<8 >>(reader);
365
+ std::shared_ptr<swift::remote::MemoryReader> reader, bool ObjCInterop) {
366
+ using ReflectionContext64ObjCInterop =
367
+ TargetReflectionContext<swift::reflection::ReflectionContext<
368
+ swift::External<swift::WithObjCInterop<swift::RuntimeTarget<8 >>>>>;
369
+ using ReflectionContext64NoObjCInterop =
370
+ TargetReflectionContext<swift::reflection::ReflectionContext<
371
+ swift::External<swift::NoObjCInterop<swift::RuntimeTarget<8 >>>>>;
372
+ if (ObjCInterop)
373
+ return std::make_unique<ReflectionContext64ObjCInterop>(reader);
374
+ return std::make_unique<ReflectionContext64NoObjCInterop>(reader);
361
375
}
362
376
363
377
SwiftLanguageRuntimeImpl::ReflectionContextInterface::
0 commit comments