]> git.saurik.com Git - apple/objc4.git/blobdiff - runtime/objc-abi.h
objc4-818.2.tar.gz
[apple/objc4.git] / runtime / objc-abi.h
index ddab3b86f15c80f034ce5aaa89e3fe35e406c1f7..937a4be54c27ddf485a7ece2e6f5ef71c3da7175 100644 (file)
@@ -46,7 +46,7 @@
 /* Linker metadata symbols */
 
 // NSObject was in Foundation/CF on macOS < 10.8.
-#if TARGET_OS_OSX
+#if TARGET_OS_OSX && (__x86_64__ || __i386__)
 #if __OBJC2__
 
 OBJC_EXPORT const char __objc_nsobject_class_10_5
@@ -100,6 +100,7 @@ typedef struct objc_image_info {
 #if __cplusplus >= 201103L
   private:
     enum : uint32_t {
+        // 1 byte assorted flags
         IsReplacement       = 1<<0,  // used for Fix&Continue, now ignored
         SupportsGC          = 1<<1,  // image supports GC
         RequiresGC          = 1<<2,  // image requires GC
@@ -107,17 +108,28 @@ typedef struct objc_image_info {
         CorrectedSynthesize = 1<<4,  // used for an old workaround, now ignored
         IsSimulated         = 1<<5,  // image compiled for a simulator platform
         HasCategoryClassProperties  = 1<<6,  // class properties in category_t
+        OptimizedByDyldClosure = 1 << 7, // dyld (not the shared cache) optimized this.
 
-        SwiftVersionMaskShift = 8,
-        SwiftVersionMask    = 0xff << SwiftVersionMaskShift  // Swift ABI version
+        // 1 byte Swift unstable ABI version number
+        SwiftUnstableVersionMaskShift = 8,
+        SwiftUnstableVersionMask = 0xff << SwiftUnstableVersionMaskShift,
 
+        // 2 byte Swift stable ABI version number
+        SwiftStableVersionMaskShift = 16,
+        SwiftStableVersionMask = 0xffffUL << SwiftStableVersionMaskShift
     };
-   public:
+  public:
     enum : uint32_t {
+        // Values for SwiftUnstableVersion
+        // All stable ABIs store SwiftVersion5 here.
         SwiftVersion1   = 1,
         SwiftVersion1_2 = 2,
         SwiftVersion2   = 3,
-        SwiftVersion3   = 4
+        SwiftVersion3   = 4,
+        SwiftVersion4   = 5,
+        SwiftVersion4_1 = 6,
+        SwiftVersion4_2 = 6,  // [sic]
+        SwiftVersion5   = 7
     };
 
   public:
@@ -126,8 +138,9 @@ typedef struct objc_image_info {
     bool requiresGC()      const { return flags & RequiresGC; }
     bool optimizedByDyld() const { return flags & OptimizedByDyld; }
     bool hasCategoryClassProperties() const { return flags & HasCategoryClassProperties; }
-    bool containsSwift()   const { return (flags & SwiftVersionMask) != 0; }
-    uint32_t swiftVersion() const { return (flags & SwiftVersionMask) >> SwiftVersionMaskShift; }
+    bool optimizedByDyldClosure() const { return flags & OptimizedByDyldClosure; }
+    bool containsSwift()   const { return (flags & SwiftUnstableVersionMask) != 0; }
+    uint32_t swiftUnstableVersion() const { return (flags & SwiftUnstableVersionMask) >> SwiftUnstableVersionMaskShift; }
 #endif
 } objc_image_info;
 
@@ -158,6 +171,15 @@ HasClassProperties:
    Old ABI: Set by some compilers. Not used by the runtime.
 */
 
+// Description of an expected duplicate class name.
+// __DATA,__objc_dupclass stores one of these. Only the main image is
+// consulted for these purposes.
+typedef struct _objc_duplicate_class {
+    uint32_t version;
+    uint32_t flags;
+    const char name[64];
+} objc_duplicate_class;
+#define OBJC_HAS_DUPLICATE_CLASS 1
 
 /* Properties */
 
@@ -399,7 +421,7 @@ objc_retainBlock(id _Nullable)
 
 // Extract class pointer from an isa field.
     
-#if TARGET_OS_SIMULATOR && !TARGET_OS_IOSMAC
+#if TARGET_OS_SIMULATOR && !TARGET_OS_MACCATALYST && !__arm64__
     // No simulators use nonpointer isa yet.
     
 #elif __LP64__
@@ -446,7 +468,10 @@ OBJC_EXPORT const struct { char c; } objc_absolute_indexed_isa_index_shift
 #if !defined(OBJC_DECLARE_SYMBOLS)
 __OSX_AVAILABLE(10.0)
 __IOS_UNAVAILABLE __TVOS_UNAVAILABLE
-__WATCHOS_UNAVAILABLE __BRIDGEOS_UNAVAILABLE
+__WATCHOS_UNAVAILABLE
+#   ifndef __APPLE_BLEACH_SDK__
+__BRIDGEOS_UNAVAILABLE
+#   endif
 #endif
 OBJC_ROOT_CLASS
 @interface Object {