From patchwork Mon Sep 5 07:26:15 2022 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: 982 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp59140wrt; Mon, 5 Sep 2022 00:38:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR4fhcB1W+auY9pLLIXKbmzKj6Se6SzLpUEohRdd9Wm7dVSAYyBH43E6gQLxFU+bwcJooqsF X-Received: by 2002:a17:906:5a42:b0:73d:b160:af0d with SMTP id my2-20020a1709065a4200b0073db160af0dmr34942253ejc.164.1662363483590; Mon, 05 Sep 2022 00:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662363483; cv=none; d=google.com; s=arc-20160816; b=qoFmAsJ/auVuC3K/vVHkFu2hdTsAkbTYXqiH/cFzCyZB6XrZrvQoosH27JNl+DVKjm UhyQEy6Z8vVuQbnG9xNpyrtHPPbrbaold90O6v+k+HrfTjn1ePlJ0s3rYK0349XTMK1F mxW6JSoe/BFTs5GTHas47xipx3LgptwkPNdqcZfqerTGLiJg35FxnjQVd9TbWwmYNDqr O+CNJGXgjrxiBk+E7qJ/1J7cEX1zYfWIY8G253tE2r1wGWPepfE0k+2o02WpnAtxe8Um V0QHcZtG9KfemigCtpfXNsAIkjwm2d3Ns80kftKSidXWLcAknqXyf95UrGDHu7azMnJQ ytDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=JLStNuhejoOv2Sa3N2768LLXuDQGiCIyYANdO05UZIM=; b=D1IIT5JIaljJO49cYPA+45Z5KDOB29y5KbiuWq6m2VuP46/W0v+kNuTE4KpylkL4ru 0JH7WXCFbrW/otHTcEWbHsTp4VaHO65fLuvk6lRaecSknGPHonpJd6q0xmQU6GbTBYqI G4rtezn0x79f6aXZin4+FkSNJPiLmTexaqPG9iFY1h97kRhLM+RtRtG2ghTVpkVWo0oI YL3papQIG7ahGeiNFU37/Pl4hcekiKwJFabdaPwGs6ZKYGQDoUEhDJNkD3MRrvxLPkZT a2Sdnh5diEOhRvK7BViLd6nnGa6xSByuErZO8wwfEvzOpDC3jN5aCXm8dGNGpBe9Mnac sQkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=toOCU2UA; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id cs15-20020a0564020c4f00b00445dfc9c0cdsi6795768edb.122.2022.09.05.00.38.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 00:38:03 -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=toOCU2UA; 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 55FB8385E010 for ; Mon, 5 Sep 2022 07:31:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55FB8385E010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662363115; bh=JLStNuhejoOv2Sa3N2768LLXuDQGiCIyYANdO05UZIM=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=toOCU2UABoKFMLcaV238z5Vvcp58LNhdqdwAr9zgYHNVOXXszVskUDeUzGMTzapo1 yFBnPhI/pD+GLArFJIHkJHSUbU05Vi4OUzSVdAXmE4B3Q8AoGUZcfZKmoIttmqaZrS dVJO++JEn2x4SNKdvbR04l4Fft3SVliiUL5l/chg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id CE731385E020 for ; Mon, 5 Sep 2022 07:26:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CE731385E020 Received: by mail-wm1-x32d.google.com with SMTP id h1so4765609wmd.3 for ; Mon, 05 Sep 2022 00:26:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=JLStNuhejoOv2Sa3N2768LLXuDQGiCIyYANdO05UZIM=; b=dcpDE4fzngeDZrpkFwJOKyAtbsuLADOm2/kANKsvPQXga556T95kA5yLcL3dZ5fROq deIC/cKlFNk7MUGGQp8vvjhkmfEoWzKN05WplJeQF/5QrSV4kSEAtTUWgzCh3aOkBxZ9 gpxXLZNmPSpSKvDRIcTu3hQi2S6TjsOAGeWOSANIreHQufJDEU+HrP4PK1pzU291+Agt PRUwKfnQY+esAO0T+aoZ6cUX2B5F7GZISo6UIRTP0gwSu3SX5c3DQCN+KT82fA0zEMdk JiChAx3fmaw3nxaEeM73QcdDUrsIN8eff+qjgKswQvlm4i6fh8f0IYSi3FimU+JSGVx7 NlYw== X-Gm-Message-State: ACgBeo31PXwKFA3bGjLxzn55lTZkT7vEreCqEZyuikYwgrubMocMPvyf F+Aq4HfGvci8CBX8bfly9kjHh7JzPl6Vrw== X-Received: by 2002:a05:600c:4e8a:b0:3a6:d89:aa24 with SMTP id f10-20020a05600c4e8a00b003a60d89aa24mr10161706wmq.149.1662362776520; Mon, 05 Sep 2022 00:26:16 -0700 (PDT) Received: from poulhies-Precision-5550 (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id f3-20020a1cc903000000b003a604a29a34sm9871055wmb.35.2022.09.05.00.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 00:26:16 -0700 (PDT) Date: Mon, 5 Sep 2022 09:26:15 +0200 To: gcc-patches@gcc.gnu.org Subject: [Ada] Cleanup iteration over aggregate component associations Message-ID: <20220905072615.GA1174852@poulhies-Precision-5550> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-12.8 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: Marc =?iso-8859-1?q?Poulhi=E8s?= Cc: Piotr Trojanek 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?1743114451738304071?= X-GMAIL-MSGID: =?utf-8?q?1743114451738304071?= Code cleanup related to fixes for iterated component associations in GNATprove ; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_aggr.adb (Resolve_Container_Aggregate): Style cleanup. (Resolve_Record_Aggregate): Remove redundant guard. diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -3182,7 +3182,7 @@ package body Sem_Aggr is end if; end; - elsif Present (Add_Named_Subp) then + elsif Present (Add_Named_Subp) then declare -- Retrieves types of container, key, and element from the -- specified insertion procedure. @@ -5048,9 +5048,7 @@ package body Sem_Aggr is -- OTHERS cannot be used. -- Positional and named associations cannot be mixed. - if Present (Component_Associations (N)) - and then Present (First (Component_Associations (N))) - then + if Present (Component_Associations (N)) then declare Assoc : Node_Id;