@@ -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:
@@ -348,14 +346,30 @@ class TargetReflectionContext
348
346
349
347
std::unique_ptr<SwiftLanguageRuntimeImpl::ReflectionContextInterface>
350
348
SwiftLanguageRuntimeImpl::ReflectionContextInterface::CreateReflectionContext32 (
351
- std::shared_ptr<swift::remote::MemoryReader> reader) {
352
- return std::make_unique<TargetReflectionContext<4 >>(reader);
349
+ std::shared_ptr<swift::remote::MemoryReader> reader, bool ObjCInterop) {
350
+ using ReflectionContext32ObjCInterop =
351
+ TargetReflectionContext<swift::reflection::ReflectionContext<
352
+ swift::External<swift::WithObjCInterop<swift::RuntimeTarget<4 >>>>>;
353
+ using ReflectionContext32NoObjCInterop =
354
+ TargetReflectionContext<swift::reflection::ReflectionContext<
355
+ swift::External<swift::NoObjCInterop<swift::RuntimeTarget<4 >>>>>;
356
+ if (ObjCInterop)
357
+ return std::make_unique<ReflectionContext32ObjCInterop>(reader);
358
+ return std::make_unique<ReflectionContext32NoObjCInterop>(reader);
353
359
}
354
360
355
361
std::unique_ptr<SwiftLanguageRuntimeImpl::ReflectionContextInterface>
356
362
SwiftLanguageRuntimeImpl::ReflectionContextInterface::CreateReflectionContext64 (
357
- std::shared_ptr<swift::remote::MemoryReader> reader) {
358
- return std::make_unique<TargetReflectionContext<8 >>(reader);
363
+ std::shared_ptr<swift::remote::MemoryReader> reader, bool ObjCInterop) {
364
+ using ReflectionContext64ObjCInterop =
365
+ TargetReflectionContext<swift::reflection::ReflectionContext<
366
+ swift::External<swift::WithObjCInterop<swift::RuntimeTarget<8 >>>>>;
367
+ using ReflectionContext64NoObjCInterop =
368
+ TargetReflectionContext<swift::reflection::ReflectionContext<
369
+ swift::External<swift::NoObjCInterop<swift::RuntimeTarget<8 >>>>>;
370
+ if (ObjCInterop)
371
+ return std::make_unique<ReflectionContext64ObjCInterop>(reader);
372
+ return std::make_unique<ReflectionContext64NoObjCInterop>(reader);
359
373
}
360
374
361
375
SwiftLanguageRuntimeImpl::ReflectionContextInterface::
0 commit comments