From patchwork Tue Oct 8 19:31:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1173493 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510491-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="rlvc9fWH"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46nnYX3Y8Jz9sDB for ; Wed, 9 Oct 2019 06:32:30 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:to; q=dns; s=default; b=vz7asRVBvz25uDE/lY3JJoX YTlsg5iyoSKl3YUh4c65GWpLKDxt9l91ghutorFXysnuCRxlJGCtxqy5soCtKRJP tGg43sf5DUa5i3wad96jl37kc3paqmUOlQBcc8fQldm5B1/vVcQH1wv76Vw0UqVN vZb8fV5ndlPs1YIwJL8Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:to; s=default; bh=6H4UTHkgf5Kj5uwsf7j5lfI3Fbo=; b= rlvc9fWHoJonT+kb5J8vlzixXrGlA5w8qOfZ0YdE3ZrLF8DR9zgqp2fd/HQSVRDm MmZZjxWYM2V94DglaoCQqm66hGz9stpXQVxPcUbvKaWDTSUBuYCuyw5KHYobJwwJ LzSvMwL12Q6DlLDCbD6UXCSslB6w0dC/YGeUoU4rnfI= Received: (qmail 130782 invoked by alias); 8 Oct 2019 19:32:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 130625 invoked by uid 89); 8 Oct 2019 19:32:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_COUK, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=HX-Spam-Relays-External:ESMTPA X-HELO: smtp2.wavenetuk.net Received: from smtp.wavenetuk.net (HELO smtp2.wavenetuk.net) (195.26.37.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 Oct 2019 19:32:21 +0000 Received: from [192.168.1.212] (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp2.wavenetuk.net (Postfix) with ESMTPA id 8AEF8600285 for ; Tue, 8 Oct 2019 20:32:18 +0100 (BST) From: Iain Sandoe Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [Darwin, committed] Remove code deprecated in 4.x. Message-Id: <047DF813-5342-49F7-B57F-130EA7B2743E@sandoe.co.uk> Date: Tue, 8 Oct 2019 20:31:58 +0100 To: GCC Patches This removes some code that should be dead. Given no reported problems from the warning since 4.6 this seems reasonable. It also happens to clear another build warning by deleting the offending code. tested on x86_64-darwin16, applied to mainline, thanks Iain gcc/ChangeLog: 2019-10-08 Iain Sandoe * config/darwin.c (machopic_select_section): Remove dead code for old Objective-C section selection method, replace with unreachable. diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index f8d70596d0..679e0c2291 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -1696,83 +1696,14 @@ machopic_select_section (tree decl, else return base_section; } - /* c) legacy meta-data selection. */ - else if (TREE_CODE (decl) == VAR_DECL + else if (flag_next_runtime + && VAR_P (decl) && DECL_NAME (decl) && TREE_CODE (DECL_NAME (decl)) == IDENTIFIER_NODE && IDENTIFIER_POINTER (DECL_NAME (decl)) - && flag_next_runtime && !strncmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "_OBJC_", 6)) - { - const char *name = IDENTIFIER_POINTER (DECL_NAME (decl)); - static bool warned_objc_46 = false; - /* We shall assert that zero-sized objects are an error in ObjC - meta-data. */ - gcc_assert (tree_to_uhwi (DECL_SIZE_UNIT (decl)) != 0); - - /* ??? This mechanism for determining the metadata section is - broken when LTO is in use, since the frontend that generated - the data is not identified. We will keep the capability for - the short term - in case any non-Objective-C programs are using - it to place data in specified sections. */ - if (!warned_objc_46) - { - location_t loc = DECL_SOURCE_LOCATION (decl); - warning_at (loc, 0, "the use of _OBJC_-prefixed variable names" - " to select meta-data sections is deprecated at 4.6" - " and will be removed in 4.7"); - warned_objc_46 = true; - } - - if (!strncmp (name, "_OBJC_CLASS_METHODS_", 20)) - return darwin_sections[objc_cls_meth_section]; - else if (!strncmp (name, "_OBJC_INSTANCE_METHODS_", 23)) - return darwin_sections[objc_inst_meth_section]; - else if (!strncmp (name, "_OBJC_CATEGORY_CLASS_METHODS_", 29)) - return darwin_sections[objc_cat_cls_meth_section]; - else if (!strncmp (name, "_OBJC_CATEGORY_INSTANCE_METHODS_", 32)) - return darwin_sections[objc_cat_inst_meth_section]; - else if (!strncmp (name, "_OBJC_CLASS_VARIABLES_", 22)) - return darwin_sections[objc_class_vars_section]; - else if (!strncmp (name, "_OBJC_INSTANCE_VARIABLES_", 25)) - return darwin_sections[objc_instance_vars_section]; - else if (!strncmp (name, "_OBJC_CLASS_PROTOCOLS_", 22)) - return darwin_sections[objc_cat_cls_meth_section]; - else if (!strncmp (name, "_OBJC_CLASS_NAME_", 17)) - return darwin_sections[objc_class_names_section]; - else if (!strncmp (name, "_OBJC_METH_VAR_NAME_", 20)) - return darwin_sections[objc_meth_var_names_section]; - else if (!strncmp (name, "_OBJC_METH_VAR_TYPE_", 20)) - return darwin_sections[objc_meth_var_types_section]; - else if (!strncmp (name, "_OBJC_CLASS_REFERENCES", 22)) - return darwin_sections[objc_cls_refs_section]; - else if (!strncmp (name, "_OBJC_CLASS_", 12)) - return darwin_sections[objc_class_section]; - else if (!strncmp (name, "_OBJC_METACLASS_", 16)) - return darwin_sections[objc_meta_class_section]; - else if (!strncmp (name, "_OBJC_CATEGORY_", 15)) - return darwin_sections[objc_category_section]; - else if (!strncmp (name, "_OBJC_SELECTOR_REFERENCES", 25)) - return darwin_sections[objc_selector_refs_section]; - else if (!strncmp (name, "_OBJC_SELECTOR_FIXUP", 20)) - return darwin_sections[objc_selector_fixup_section]; - else if (!strncmp (name, "_OBJC_SYMBOLS", 13)) - return darwin_sections[objc_symbols_section]; - else if (!strncmp (name, "_OBJC_MODULES", 13)) - return darwin_sections[objc_module_info_section]; - else if (!strncmp (name, "_OBJC_IMAGE_INFO", 16)) - return darwin_sections[objc_image_info_section]; - else if (!strncmp (name, "_OBJC_PROTOCOL_INSTANCE_METHODS_", 32)) - return darwin_sections[objc_cat_inst_meth_section]; - else if (!strncmp (name, "_OBJC_PROTOCOL_CLASS_METHODS_", 29)) - return darwin_sections[objc_cat_cls_meth_section]; - else if (!strncmp (name, "_OBJC_PROTOCOL_REFS_", 20)) - return darwin_sections[objc_cat_cls_meth_section]; - else if (!strncmp (name, "_OBJC_PROTOCOL_", 15)) - return darwin_sections[objc_protocol_section]; - else - return base_section; - } + /* c) legacy meta-data selection was deprecated at 4.6, removed now. */ + gcc_unreachable (); return base_section; }