]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Objective-C, NeXT: Reorganise meta-data declarations.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 5 Dec 2021 20:15:40 +0000 (20:15 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Sun, 5 Dec 2021 20:22:16 +0000 (20:22 +0000)
This moves the GTY declaration of the meta-data indentifier
array into the header that enumerates these and provides
shorthand defines for them.  This avoids a problem seen with
a relocatable PCH implementation.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/objc/ChangeLog:

* objc-next-metadata-tags.h (objc_rt_trees): Declare here.
* objc-next-runtime-abi-01.c: Remove from here.
* objc-next-runtime-abi-02.c: Likewise.
* objc-runtime-shared-support.c: Reorder headers, provide
a GTY declaration the definition of objc_rt_trees.

gcc/objc/objc-next-metadata-tags.h
gcc/objc/objc-next-runtime-abi-01.c
gcc/objc/objc-next-runtime-abi-02.c
gcc/objc/objc-runtime-shared-support.c

index ceb87832359245a99db23597d87f33a92915023f..aea14558b5cce6d944f61cb2c2716518237d3a83 100644 (file)
@@ -79,6 +79,8 @@ enum objc_runtime_tree_index
   OCTI_RT_META_MAX
 };
 
+extern GTY(()) tree objc_rt_trees[OCTI_RT_META_MAX];
+
 /* Tags for the META data so that the backend can put them in the correct
    sections for targets/runtimes (Darwin/NeXT) that require this.
    This information also survives LTO - which might produce mixed language
index 12f8bdc0b9cfe3063612bc5435338a340e9cb5f3..0f76162c70e77e6efc65173ba2a06ed45e991654 100644 (file)
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3.  If not see
 
 #include "objc-runtime-hooks.h"
 #include "objc-runtime-shared-support.h"
+#include "objc-next-metadata-tags.h"
 #include "objc-encoding.h"
 
 /* NeXT ABI 0 and 1 private definitions.  */
@@ -99,14 +100,6 @@ along with GCC; see the file COPYING3.  If not see
 
 #define CLS_HAS_CXX_STRUCTORS          0x2000L
 
-/* rt_trees identifiers - shared between NeXT implementations.  These
-   allow the FE to tag meta-data in a manner that survives LTO and can
-   be used when the runtime requires that certain meta-data items
-   appear in particular named sections.  */
-
-#include "objc-next-metadata-tags.h"
-extern GTY(()) tree objc_rt_trees[OCTI_RT_META_MAX];
-
 static void next_runtime_01_initialize (void);
 
 static tree next_runtime_abi_01_super_superclassfield_id (void);
index 7ca0fd7cf00de1d180657c5a8a5aa7e00b0ddc19..913ed643782596f95472f4e185a0487abff6fe40 100644 (file)
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3.  If not see
 
 #include "objc-runtime-hooks.h"
 #include "objc-runtime-shared-support.h"
+#include "objc-next-metadata-tags.h"
 #include "objc-encoding.h"
 
 /* ABI 2 Private definitions. */
@@ -180,14 +181,6 @@ enum objc_v2_tree_index
 #define objc_rethrow_exception_decl \
                                objc_v2_global_trees[OCTI_V2_RETHROW_DECL]
 
-/* rt_trees identifiers - shared between NeXT implementations.  These allow
-   the FE to tag meta-data in a manner that survives LTO and can be used when
-   the  runtime requires that certain meta-data items appear in particular
-   named sections.  */
-
-#include "objc-next-metadata-tags.h"
-extern GTY(()) tree objc_rt_trees[OCTI_RT_META_MAX];
-
 /* The OCTI_V2_... enumeration itself is in above.  */
 static GTY(()) tree objc_v2_global_trees[OCTI_V2_MAX];
 
index 40f506c6e75f8b9326c78709092e64179dba24c3..0d3036f478e30b8b6bf90d515b5d5f827573f330 100644 (file)
@@ -44,16 +44,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "objc-runtime-hooks.h"
 
 #include "objc-runtime-shared-support.h"
-#include "objc-encoding.h"
-
-/* rt_trees identifiers - shared between NeXT implementations.  These allow
-   the FE to tag meta-data in a manner that survives LTO and can be used when
-   the  runtime requires that certain meta-data items appear in particular
-   named sections.  */
 #include "objc-next-metadata-tags.h"
-extern GTY(()) tree objc_rt_trees[OCTI_RT_META_MAX];
+#include "objc-encoding.h"
 
 /* Rather than repeatedly looking up the identifiers, we save them here.  */
+extern GTY(()) tree objc_rt_trees[OCTI_RT_META_MAX];
 tree objc_rt_trees[OCTI_RT_META_MAX];
 
 /* For building an objc struct.  These might not be used when this file