From patchwork Wed Apr 14 12:47:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1466225 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=LjzPMMur; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FL2LV4tMdz9sV5 for ; Wed, 14 Apr 2021 22:47:30 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9CE8A39484B4; Wed, 14 Apr 2021 12:47:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9CE8A39484B4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1618404447; bh=GzZQlTRop3V/5wzupyMEvQ/9Swxw8Pi+qRzW0BXJc+4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=LjzPMMureahGts849DfG0whuEfLq4jigL66+bP07VB0ei4cFTSNHCi53ik35/Y3SO ZnFRp5gqCVhWZVr1aHoYMXSHrUQWIYAcbc1bpmhcGHNS9Qijrazazi09qUBgs4pbMw Qf6Cn6xJNOMsIYNfy4SnhXxgb4pkJg+/qulpvvG8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050::465:201]) by sourceware.org (Postfix) with ESMTPS id 59F41395187A for ; Wed, 14 Apr 2021 12:47:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 59F41395187A Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4FL2LN1dFyzQk13; Wed, 14 Apr 2021 14:47:24 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id 2yZINMT2janp; Wed, 14 Apr 2021 14:47:17 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed] d: Remove setting of target-specific global.params flags from front-end Date: Wed, 14 Apr 2021 14:47:15 +0200 Message-Id: <20210414124715.400602-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-MBO-SPAM-Probability: * X-Rspamd-Score: 1.29 / 15.00 / 15.00 X-Rspamd-Queue-Id: 3645B1890 X-Rspamd-UID: 639464 X-Spam-Status: No, score=-15.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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 Buclaw via Gcc-patches From: Iain Buclaw Reply-To: Iain Buclaw Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, This patch removes the setting of all target-specific global.params flags from the D front-end. Now that all dependencies on these flags have been removed, there's no need to test and set them. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, and committed to mainline. Regards Iain. --- gcc/d/ChangeLog: * d-builtins.cc (d_add_builtin_version): Remove all setting of target-specific global.params. * typeinfo.cc (create_typeinfo): Don't add argType fields to TypeInfo_Struct. --- gcc/d/d-builtins.cc | 19 ------------------- gcc/d/typeinfo.cc | 5 +---- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/gcc/d/d-builtins.cc b/gcc/d/d-builtins.cc index ce098617c62..400bce0a141 100644 --- a/gcc/d/d-builtins.cc +++ b/gcc/d/d-builtins.cc @@ -418,25 +418,6 @@ d_eval_constant_expression (const Loc &loc, tree cst) void d_add_builtin_version (const char* ident) { - /* For now, we need to tell the D frontend what platform is being targeted. - This should be removed once the frontend has been fixed. */ - if (strcmp (ident, "linux") == 0) - global.params.isLinux = true; - else if (strcmp (ident, "OSX") == 0) - global.params.isOSX = true; - else if (strcmp (ident, "Windows") == 0) - global.params.isWindows = true; - else if (strcmp (ident, "FreeBSD") == 0) - global.params.isFreeBSD = true; - else if (strcmp (ident, "OpenBSD") == 0) - global.params.isOpenBSD = true; - else if (strcmp (ident, "Solaris") == 0) - global.params.isSolaris = true; - /* The is64bit field only refers to x86_64 target. */ - else if (strcmp (ident, "X86_64") == 0) - global.params.is64bit = true; - /* No other fields are required to be set for the frontend. */ - VersionCondition::addPredefinedGlobalIdent (ident); } diff --git a/gcc/d/typeinfo.cc b/gcc/d/typeinfo.cc index f8ffcbfff25..503480b491d 100644 --- a/gcc/d/typeinfo.cc +++ b/gcc/d/typeinfo.cc @@ -1562,9 +1562,6 @@ create_typeinfo (Type *type, Module *mod) case TK_STRUCT_TYPE: if (!tinfo_types[tk]) { - /* Some ABIs add extra TypeInfo fields on the end. */ - tree argtype = global.params.is64bit ? ptr_type_node : NULL_TREE; - ident = Identifier::idPool ("TypeInfo_Struct"); make_internal_typeinfo (tk, ident, array_type_node, array_type_node, @@ -1572,7 +1569,7 @@ create_typeinfo (Type *type, Module *mod) ptr_type_node, ptr_type_node, d_uint_type, ptr_type_node, ptr_type_node, d_uint_type, - ptr_type_node, argtype, argtype, NULL); + ptr_type_node, NULL); } t->vtinfo = TypeInfoStructDeclaration::create (t); break;