From patchwork Sun Dec 5 20:25:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 48514 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3F07A3858414 for ; Sun, 5 Dec 2021 20:26:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F07A3858414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1638735963; bh=km4CKA6Rw+V8XzRAiaIEnQd44olrZmOZYLbJMu5OAlw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=rlHvCsBacEtCmWu2x1SHaBLOIRF6blV0Ti14ctOJ2VwgdBvKsF9mElKEmDldofYHl +8Ll+4ZlEQAqhoB8bUtto50mq4Ac+VbYHiJlAwymzMVPTHTmMlmGVhx6+kchmd8dUr kotTs7Pj3I49jtpX6mK/kC17dqHFeszA+E5HuiB0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 89BDD3858D39 for ; Sun, 5 Dec 2021 20:25:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 89BDD3858D39 Received: by mail-wm1-x334.google.com with SMTP id i8-20020a7bc948000000b0030db7b70b6bso8928264wml.1 for ; Sun, 05 Dec 2021 12:25:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:reply-to :mime-version:content-transfer-encoding; bh=km4CKA6Rw+V8XzRAiaIEnQd44olrZmOZYLbJMu5OAlw=; b=UNJwIgMw2hbS4YNJtDpy5u4HMsg7gB04GcKBGh9BaLQM5s3Ow+2PJg6uahS9jXMMgW Zu8xE7Mtt+wzcvqLBPV2BQl08EQFsKPorboQA+rVVP+lBfgG1M1p8hGd4L/sQMUmE/0g tdYETqukfXazoIUlXSJZFc6mUY8YX9WfpR7/VS/7uop868Yy1AXreSOfEfUpBreA7PLi QxXad5WT2dB3++wGhsNEEDyiei0he8RPYjHbY8bcswdgVub19E8J9LKAWNQCwELDqhfq mOLPKMf5qgyn/5Syw3VHjN+BK48pu7sKkNhVd0ISVhT02hbJR0to27h+zXMSE03TrXAx fH+w== X-Gm-Message-State: AOAM531rouVOCYAKYBgiLktMH7fxNaYijzr1PbT+FsrNxscpw24kmh/r FsT0qWQ5Ar/7yMgMJz1OKdnwLaqXZDc= X-Google-Smtp-Source: ABdhPJy/VkqrcGsSu6l34oeDbKGm4c76RRWKU4WcTpsFRUembwTeRHl4BRWD8leOMn9C+rIm5FJkGQ== X-Received: by 2002:a05:600c:501f:: with SMTP id n31mr33132792wmr.101.1638735932427; Sun, 05 Dec 2021 12:25:32 -0800 (PST) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id d8sm9025909wrm.76.2021.12.05.12.25.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Dec 2021 12:25:32 -0800 (PST) X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] Objective-C, NeXT: Reorganise meta-data declarations. Date: Sun, 5 Dec 2021 20:25:25 +0000 Message-Id: <20211205202525.34297-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Sandoe via Gcc-patches From: Iain Sandoe Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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. Tested on x86_64, i686 Darwin, pushed to master, thanks Iain Signed-off-by: Iain Sandoe 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 | 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