]> git.saurik.com Git - apple/ld64.git/blobdiff - src/ld/passes/objc.cpp
ld64-236.3.tar.gz
[apple/ld64.git] / src / ld / passes / objc.cpp
index cf6f1d4095bfb140e1d41acb1689bececef1ea16..d921a64fb515100d69668828fa22fc6c6b0721a6 100644 (file)
@@ -54,6 +54,7 @@ struct objc_image_info  {
 #define OBJC_IMAGE_REQUIRES_GC                 (1<<2)
 #define OBJC_IMAGE_OPTIMIZED_BY_DYLD   (1<<3)
 #define OBJC_IMAGE_SUPPORTS_COMPACTION (1<<4)
+#define OBJC_IMAGE_IS_SIMULATED                        (1<<5)
 
 
 
@@ -67,8 +68,6 @@ public:
                                                                                                                        bool compaction, bool abi2);
 
        virtual const ld::File*                                 file() const                                    { return NULL; }
-       virtual bool                                                    translationUnitSource(const char** dir, const char**) const 
-                                                                                                                                                       { return false; }
        virtual const char*                                             name() const                                    { return "objc image info"; }
        virtual uint64_t                                                size() const                                    { return sizeof(objc_image_info); }
        virtual uint64_t                                                objectAddress() const                   { return 0; }
@@ -113,6 +112,9 @@ ObjCImageInfoAtom<A>::ObjCImageInfoAtom(ld::File::ObjcConstraint objcConstraint,
                        if ( compaction ) 
                                value |= OBJC_IMAGE_SUPPORTS_COMPACTION;
                        break;
+               case ld::File::objcConstraintRetainReleaseForSimulator:
+                               value |= OBJC_IMAGE_IS_SIMULATED;
+                       break;
        }
 
        _content.version = 0;
@@ -132,8 +134,6 @@ public:
                                                                                                                        std::set<const ld::Atom*>& deadAtoms);
 
        virtual const ld::File*                                 file() const                                    { return _file; }
-       virtual bool                                                    translationUnitSource(const char** dir, const char**) const 
-                                                                                                                                                       { return false; }
        virtual const char*                                             name() const                                    { return "objc merged method list"; }
        virtual uint64_t                                                size() const                                    { return _methodCount*3*sizeof(pint_t) + 8; }
        virtual uint64_t                                                objectAddress() const                   { return 0; }
@@ -171,8 +171,6 @@ public:
                                                                                                                        std::set<const ld::Atom*>& deadAtoms);
 
        virtual const ld::File*                                 file() const                                    { return _file; }
-       virtual bool                                                    translationUnitSource(const char** dir, const char**) const 
-                                                                                                                                                       { return false; }
        virtual const char*                                             name() const                                    { return "objc merged protocol list"; }
        virtual uint64_t                                                size() const                                    { return (_protocolCount+1)*sizeof(pint_t); }
        virtual uint64_t                                                objectAddress() const                   { return 0; }
@@ -210,8 +208,6 @@ public:
                                                                                                                        std::set<const ld::Atom*>& deadAtoms);
 
        virtual const ld::File*                                 file() const                                    { return _file; }
-       virtual bool                                                    translationUnitSource(const char** dir, const char**) const 
-                                                                                                                                                       { return false; }
        virtual const char*                                             name() const                                    { return "objc merged property list"; }
        virtual uint64_t                                                size() const                                    { return _propertyCount*2*sizeof(pint_t) + 8; }
        virtual uint64_t                                                objectAddress() const                   { return 0; }
@@ -252,8 +248,6 @@ public:
 
        // overrides of ld::Atom
        virtual const ld::File*                         file() const            { return _atom->file(); }
-       virtual bool                                            translationUnitSource(const char** dir, const char** nm) const
-                                                                                                                       { return _atom->translationUnitSource(dir, nm); }
        virtual const char*                                     name() const            { return _atom->name(); }
        virtual uint64_t                                        size() const            { return _atom->size(); }
        virtual uint64_t                                        objectAddress() const { return _atom->objectAddress(); }
@@ -1186,10 +1180,18 @@ void doPass(const Options& opts, ld::Internal& state)
                                                        opts.objCABIVersion2POverride() ? true : false));
                                break;
 #endif
+#if SUPPORT_ARCH_arm_any
                        case CPU_TYPE_ARM:
                                state.addAtom(*new ObjCImageInfoAtom<arm>(state.objcObjectConstraint, compaction, 
                                                        true));
                                break;
+#endif
+#if SUPPORT_ARCH_arm64
+                       case CPU_TYPE_ARM64:
+                               state.addAtom(*new ObjCImageInfoAtom<arm64>(state.objcObjectConstraint, compaction, 
+                                                       true));
+                               break;
+#endif
                        default:
                                assert(0 && "unknown objc arch");
                }       
@@ -1205,16 +1207,19 @@ void doPass(const Options& opts, ld::Internal& state)
 #endif
 #if SUPPORT_ARCH_i386
                        case CPU_TYPE_I386:
-                               // disable optimization until fully tested
                                if ( opts.objCABIVersion2POverride() )
                     OptimizeCategories<x86>::doit(opts, state);
                                break;
 #endif
 #if SUPPORT_ARCH_arm_any
                        case CPU_TYPE_ARM:
-                               // disable optimization until fully tested
                                OptimizeCategories<arm>::doit(opts, state);
                                break;
+#endif
+#if SUPPORT_ARCH_arm64
+                       case CPU_TYPE_ARM64:
+                               // disabled until tested
+                               break;
 #endif
                        default:
                                assert(0 && "unknown objc arch");