public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Iain D Sandoe <iains@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-5797] Objective-C, NeXT: Reorganise meta-data declarations. Date: Sun, 5 Dec 2021 20:22:32 +0000 (GMT) [thread overview] Message-ID: <20211205202232.9BCC03858D39@sourceware.org> (raw) https://gcc.gnu.org/g:c9419faef0bfaf31e6a6f744baa064892e0d105c commit r12-5797-gc9419faef0bfaf31e6a6f744baa064892e0d105c Author: Iain Sandoe <iain@sandoe.co.uk> Date: Sun Dec 5 20:15:40 2021 +0000 Objective-C, NeXT: Reorganise meta-data declarations. 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. Diff: --- gcc/objc/objc-next-metadata-tags.h | 2 ++ gcc/objc/objc-next-runtime-abi-01.c | 9 +-------- gcc/objc/objc-next-runtime-abi-02.c | 9 +-------- gcc/objc/objc-runtime-shared-support.c | 9 ++------- 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/gcc/objc/objc-next-metadata-tags.h b/gcc/objc/objc-next-metadata-tags.h index ceb87832359..aea14558b5c 100644 --- a/gcc/objc/objc-next-metadata-tags.h +++ b/gcc/objc/objc-next-metadata-tags.h @@ -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 diff --git a/gcc/objc/objc-next-runtime-abi-01.c b/gcc/objc/objc-next-runtime-abi-01.c index 12f8bdc0b9c..0f76162c70e 100644 --- a/gcc/objc/objc-next-runtime-abi-01.c +++ b/gcc/objc/objc-next-runtime-abi-01.c @@ -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); diff --git a/gcc/objc/objc-next-runtime-abi-02.c b/gcc/objc/objc-next-runtime-abi-02.c index 7ca0fd7cf00..913ed643782 100644 --- a/gcc/objc/objc-next-runtime-abi-02.c +++ b/gcc/objc/objc-next-runtime-abi-02.c @@ -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]; diff --git a/gcc/objc/objc-runtime-shared-support.c b/gcc/objc/objc-runtime-shared-support.c index 40f506c6e75..0d3036f478e 100644 --- a/gcc/objc/objc-runtime-shared-support.c +++ b/gcc/objc/objc-runtime-shared-support.c @@ -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
reply other threads:[~2021-12-05 20:22 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20211205202232.9BCC03858D39@sourceware.org \ --to=iains@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).