From patchwork Thu May 25 08:06:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 98861 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp200379vqr; Thu, 25 May 2023 01:20:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4VXOGN0G84ZmhFsRd5I+ITgKj4sQqtwf0lANJC6xuKpQI4g5ykHqcez4O+zZSfPAATh9cd X-Received: by 2002:a17:906:ee81:b0:973:9a6c:2a6 with SMTP id wt1-20020a170906ee8100b009739a6c02a6mr662466ejb.49.1685002841233; Thu, 25 May 2023 01:20:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685002841; cv=none; d=google.com; s=arc-20160816; b=EpY/jgJ3MwEOYla/IDvwJttroGk3QSo6mfxEsBJpmGtgK5Qkus2agQpUH1qD0KJgqg lxTDdCgEV0BIPSaq6DHQeBHvsssQJ7dtOBEWMQJnitLR8T7Gpzm4pNohlpIwQkpX4vht G+T8CnPIH1HC568no9cRL5eV/XcKRUIrZMHf4iGsq42yb+4uy4PRVpA/sfyF1tVMH4AZ QB9Q5QojIf3+NZFnB4AxI7AG20b7UnHgCZ9+NIhBHyY8PeRLwueaJHYmDUCxJpiP6F+Z 87oykCBGAojv+63gN/ucs+l/j/uvscy4dpfjk+JjaltJUGTaGlHInGCwSYiKE6oR41pA 60CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=zdDPKmzMGL3UM/Tg5BV76gKVYDBnb97PooprqtUYhu4=; b=uTnRVdlwoaaY+wH/2/jOnJ0YbTmso9qClyu/CUu5clLdj5CJB3XSPE/mDccaKg4tJP WAqD2XR2eupQl4rlKuZ+RzfL7F2BcbZ0dBY4M4AKwbdbAGqsJUY6znhqru3zh9TeKwOl hf5yGvkXwR0kSkE6qSHPDyR2Z9/yQvoMuW2dpuPSmXz6zNej77InPSAeOJNh9ljGYGaP k+SD+tmWOkrLJjo4Ud6b79MBy1wb91Lu/A5RdkdGURoUCVJCP2uP1skHUJToleltcITk mZrgMgrXoHO4cwn4/o0urGetVq0cbDcc2GRJLMHjpMipBGcUlj97PyM/WmUhkK3f+j/p XkOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=p52GhuBY; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id z6-20020aa7c646000000b0050d8bf01a68si557451edr.428.2023.05.25.01.20.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:20:41 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=p52GhuBY; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 01245388202B for ; Thu, 25 May 2023 08:13:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01245388202B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685002418; bh=zdDPKmzMGL3UM/Tg5BV76gKVYDBnb97PooprqtUYhu4=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=p52GhuBYELJqmFDNrPW1vA6YdT6Wuc9k40dbbWVgYd/jKmiS/J94knVIiq1569g10 FITGBiaUCMy+3r/bPUi3a91PIwAVf2CRxnEjVOqCMq2WGux+uqHt1X5jgL6megBPbP 4qEAj5jenXlIfaR7G4vHPpPrv0KYhj6EnOQfYzIo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id A74383844053 for ; Thu, 25 May 2023 08:06:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A74383844053 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-30a4ebbda56so1759257f8f.1 for ; Thu, 25 May 2023 01:06:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685001966; x=1687593966; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zdDPKmzMGL3UM/Tg5BV76gKVYDBnb97PooprqtUYhu4=; b=BfEAW3cW/PmoGl9O4GU9bwLhQ3vgd7kF9rVEt8tNZlCF/e6Tnq7Fs+4N7yXTuUX8qZ 6RZhKtat8GDjQqPAwWSNYDIPwDsb+BejkJix9Abf9NeO/YpMZenw3Xt2eAu+SnzZ0bwP YIZDmk7cF/lKozk7+nJzF0NMcvWkACFuHh5ToT27Ic2jXWny+mboXmNbjEQr+i3GYvPA G4afIaz9sgDGhN7ZCEMcbTh2i/eZgWtkby+GVuBuKi1ThNo4jICHm4uppKoK2tmIZGX0 CVg3Q4O7+WAmt4l6OgiT5QBKAFqTBGroG/Iyz3i4V+49e/MLbL06xSOLv/XwytVBm2Oo cB3w== X-Gm-Message-State: AC+VfDyabr9oQjtERB6ObEm7D6krYvkiWayeYr1ZctIvTiwUbqyDJEZr ahqDtlHIIocrl35mScXG29x+E9IgJuBhBzx3XBg6Pg== X-Received: by 2002:adf:f310:0:b0:2f9:a798:602f with SMTP id i16-20020adff310000000b002f9a798602fmr1584628wro.48.1685001966252; Thu, 25 May 2023 01:06:06 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id k25-20020a05600c1c9900b003f1738d0d13sm11716510wms.1.2023.05.25.01.06.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:06:05 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Deconstruct a no longer used parameter of New_Copy_Tree Date: Thu, 25 May 2023 10:06:04 +0200 Message-Id: <20230525080604.1957044-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766853539510184619?= X-GMAIL-MSGID: =?utf-8?q?1766853539510184619?= From: Piotr Trojanek Parameter Scopes_In_EWA_OK of New_Copy_Tree was introduced in 2018 to deal with expressions-with-actions (EWA) in the build-in-place machinery. However, after changes made in 2022 it is no longer used by any caller. Cleanup related to handling of expression functions in GNATprove; semantics is unaffected. gcc/ada/ * sem_util.ads (New_Copy_Tree): Remove Scopes_In_EWA_OK from spec; adapt comment. * sem_util.adb (New_Copy_Tree): Remove Scopes_In_EWA_OK from body; adapt code. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 16 ++++++---------- gcc/ada/sem_util.ads | 13 ++++--------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 8b536ec4e42..b83c75939c7 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -23067,11 +23067,10 @@ package body Sem_Util is ------------------- function New_Copy_Tree - (Source : Node_Id; - Map : Elist_Id := No_Elist; - New_Sloc : Source_Ptr := No_Location; - New_Scope : Entity_Id := Empty; - Scopes_In_EWA_OK : Boolean := False) return Node_Id + (Source : Node_Id; + Map : Elist_Id := No_Elist; + New_Sloc : Source_Ptr := No_Location; + New_Scope : Entity_Id := Empty) return Node_Id is -- This routine performs low-level tree manipulations and needs access -- to the internals of the tree. @@ -24030,12 +24029,9 @@ package body Sem_Util is return; -- Nothing to do when the entity is defined in a scoping construct - -- within an N_Expression_With_Actions node, unless the caller has - -- requested their replication. + -- within an N_Expression_With_Actions node. - -- ??? should this restriction be eliminated? - - elsif EWA_Inner_Scope_Level > 0 and then not Scopes_In_EWA_OK then + elsif EWA_Inner_Scope_Level > 0 then return; -- Nothing to do when the entity does not denote a construct that diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 4962c62fa7d..185cf2ceabd 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -2630,11 +2630,10 @@ package Sem_Util is -- names to facilitate debugging the tree copy. function New_Copy_Tree - (Source : Node_Id; - Map : Elist_Id := No_Elist; - New_Sloc : Source_Ptr := No_Location; - New_Scope : Entity_Id := Empty; - Scopes_In_EWA_OK : Boolean := False) return Node_Id; + (Source : Node_Id; + Map : Elist_Id := No_Elist; + New_Sloc : Source_Ptr := No_Location; + New_Scope : Entity_Id := Empty) return Node_Id; -- Perform a deep copy of the subtree rooted at Source. Entities, itypes, -- and nodes are handled separately as follows: -- @@ -2704,10 +2703,6 @@ package Sem_Util is -- -- Parameter New_Scope may be used to specify a new scope for all copied -- entities and itypes. - -- - -- Parameter Scopes_In_EWA_OK may be used to force the replication of both - -- scoping entities and non-scoping entities found within expression with - -- actions nodes. function New_External_Entity (Kind : Entity_Kind;