From patchwork Thu Jun 15 08:03:48 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: 71142 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 01F34385773A for ; Thu, 15 Jun 2023 08:04:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01F34385773A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686816264; bh=5G9HWdWsZe2QdIVYOjyEtIVuk5UpwjuDNOQuz2b56qs=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=TfpD7x8avehZet/nzn00YS5Ns36v5uTlLmqFaaq+yiujlSqAoFvI6XGje7iZhM/jl Lg4GHNTQ/+8F5L0BoSsEFcdqtI53wOlB39ni6paFxxXxsar6Aq/UuI7s3gj2N5liil qPx+wIjg7DClnirYfsRo9PBtitD0pZo8+anh2Gvw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 3CFBE3858C1F for ; Thu, 15 Jun 2023 08:03:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3CFBE3858C1F Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f78a32266bso16647715e9.3 for ; Thu, 15 Jun 2023 01:03:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686816231; x=1689408231; 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=5G9HWdWsZe2QdIVYOjyEtIVuk5UpwjuDNOQuz2b56qs=; b=CnGD84KYhwwjA5sS7yAQZNrbY/+cKsE9zDsvCoME6YmWNRMrM5x6LrAJoNhYsPN3fL utFXHRi4wXzHlynbthOxtjNn2d1iLj7+Uy5wk3bQiDmbDEIS7r72FrdEHjg0wncHsON5 AJ//C3utmc6g+pHMHFc1J1ysZBehsZLRCi1uxBeI+LqZzud6c6Do7ujwozRLI6v6orZY tAC+mPDY84HIk8r80mpZD7MR4i7mnyPGbrhyIIUW68q1odd2Q1XOkDQHPsgspdow5WBh h6GvmCyEiwEknIu2CpdRMpYMFZhqEwnI9ZIpRFG38hqDDboPcDTrzhMu+6A83/Zuns8W N75w== X-Gm-Message-State: AC+VfDzcL1yO7ZIRUOpx6y2QqVlaqhSx3zRWvvNZSFR4iAug9eBlriCR U3xuaZZ5uIhiQo2ukvO2x9wbgWQl4Wi0U/DGa4yMRQ== X-Google-Smtp-Source: ACHHUZ7qlVkMeO7kYL+wDT1h+i0zHTr5/TzRWkkZmhT6PrnXq7cgtmTlXYaHyRKhk/0w7nwstgQn4Q== X-Received: by 2002:a1c:6a04:0:b0:3f6:143:7c4b with SMTP id f4-20020a1c6a04000000b003f601437c4bmr14717097wmc.6.1686816230806; Thu, 15 Jun 2023 01:03:50 -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 12-20020a05600c228c00b003f4e3ed98ffsm19676274wmf.35.2023.06.15.01.03.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 01:03:50 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Cleanup analysis of iterated component association Date: Thu, 15 Jun 2023 10:03:48 +0200 Message-Id: <20230615080348.938724-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: Piotr Trojanek Cleanups related to analysis of iterated component association for GNATprove. gcc/ada/ * sem_aggr.adb (Resolve_Array_Aggregate): Simplify comment. (Resolve_Iterated_Component_Association): Tune comment; change variable to constant. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_aggr.adb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index c6063c78bf6..39189463871 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -1331,9 +1331,9 @@ package body Sem_Aggr is -- In this event we do not resolve Expr unless expansion is disabled. -- To know why, see the DELAYED COMPONENT RESOLUTION note above. -- - -- NOTE: In the case of "... => <>", we pass the in the - -- N_Component_Association node as Expr, since there is no Expression in - -- that case, and we need a Sloc for the error message. + -- NOTE: In the case of "... => <>", we pass the N_Component_Association + -- node as Expr, since there is no Expression and we need a Sloc for the + -- error message. procedure Resolve_Iterated_Component_Association (N : Node_Id; @@ -1790,7 +1790,7 @@ package body Sem_Aggr is Choice : Node_Id; Dummy : Boolean; Scop : Entity_Id; - Expr : Node_Id; + Expr : constant Node_Id := Expression (N); -- Start of processing for Resolve_Iterated_Component_Association @@ -1854,14 +1854,12 @@ package body Sem_Aggr is Set_Scope (Id, Scop); end if; - -- Analyze expression without expansion, to verify legality. + -- Analyze expression without expansion, to verify legality. -- When generating code, we then remove references to the index -- variable, because the expression will be analyzed anew after -- rewritting as a loop with a new index variable; when not -- generating code we leave the analyzed expression as it is. - Expr := Expression (N); - Dummy := Resolve_Aggr_Expr (Expr, Single_Elmt => False); if Operating_Mode /= Check_Semantics then