@@ -55,6 +55,13 @@ static inline void
5555swift_reflection_interop_destroyReflectionContext (
5656 SwiftReflectionInteropContextRef ContextRef);
5757
58+ // / Set the is-Swift mask for the stable ABI on the current system.
59+ // / NOTE: must be called after interop_addLibrary is used to add the
60+ // / stable ABI remote mirror library in order to take effect.
61+ static inline void
62+ swift_reflection_interop_setClassIsSwiftMask (
63+ SwiftReflectionInteropContextRef ContextRef, uint64_t mask);
64+
5865static inline int
5966swift_reflection_interop_addImage (SwiftReflectionInteropContextRef ContextRef,
6067 swift_addr_t imageStart);
@@ -175,6 +182,8 @@ typedef int (*ReadBytesFunctionLegacy)(void *reader_context, swift_addr_t addres
175182 void *dest, uint64_t size);
176183
177184struct SwiftReflectionFunctions {
185+ unsigned long long *classIsSwiftMaskPtr;
186+
178187 uint16_t (*getSupportedMetadataVersion)(void );
179188
180189 SwiftReflectionContextRef (*createReflectionContext)(
@@ -406,6 +415,8 @@ swift_reflection_interop_loadFunctions(struct SwiftReflectionInteropContext *Con
406415 } while (0 )
407416#define LOAD (name ) LOAD_NAMED(name, " swift_reflection_" #name)
408417
418+ Functions->classIsSwiftMaskPtr =
419+ (unsigned long long *)dlsym (Handle, " swift_reflection_classIsSwiftMask" );
409420 LOAD (getSupportedMetadataVersion);
410421 uint16_t version = Functions->getSupportedMetadataVersion ();
411422 if (version < SWIFT_LEGACY_METADATA_MIN_VERSION)
@@ -575,6 +586,15 @@ swift_reflection_interop_destroyReflectionContext(
575586 free (ContextRef);
576587}
577588
589+ static inline void
590+ swift_reflection_interop_setClassIsSwiftMask (
591+ SwiftReflectionInteropContextRef ContextRef, uint64_t mask) {
592+ FOREACH_LIBRARY {
593+ if (Library->Functions .classIsSwiftMaskPtr )
594+ *Library->Functions .classIsSwiftMaskPtr = mask;
595+ }
596+ }
597+
578598#ifndef __LP64__
579599typedef const struct mach_header MachHeader;
580600#else
0 commit comments