From patchwork Thu May 25 08:05:51 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: 98854 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp198571vqr; Thu, 25 May 2023 01:16:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6QsQ3IsMbuwk7UlmzTzqvv80gu/N2+k6zSXB86PxtrunKSYyh6Icush5EDXOq/5E0P3of+ X-Received: by 2002:a17:907:934a:b0:961:8570:4589 with SMTP id bv10-20020a170907934a00b0096185704589mr697416ejc.30.1685002590853; Thu, 25 May 2023 01:16:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685002590; cv=none; d=google.com; s=arc-20160816; b=LJrj4192I07IN5vE2T0stWSPA1hSCNB6VtZuy3xbkjqTcK2jNju4+ZJT2HnyfpDEl0 LIabBu/mdZ4kbDaCJXpqjicmGMW6hp7aWfPkk+ZfIDfa22KMliOR8J6ikkg3+fubOPeG d/hZpnxGlZkpG4ViZjU1R7d2Nvbw/4WGQVMx1wYlRS3KoTD54ckDDc71+sZ+37xc2E4K Yizmnf2aNf5b4uOMPDakT4beVS3b2FTrpoiikDlEPLpDji+EXp3j5QecZItdAtojXp0b yDyvn+7xm/ZK8DhmV6te5rIGaVcbUfQhR+75QVD1b2GBW1VO/BgHD7JbHy81GsasN447 1yiA== 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=/mcCNq8az0SKBCZ7fYdweotU1OHNPNYnoSWJj97OlQE=; b=RVpfS4HfFd7qyo32wWyUJohyQF3e/VNvrj6mYErh+Stne64c8+Qqfm0OcPednKaARl bZ0laYDzPvFLzeaAl9QjKWoGa6HMwgLyQiqzVoAF8CEOnwOjh25V6OXefvFrTzZb8ykL EtkbKZo4/l4SMPjZ6zCRO6gKNytG/q7R5Aea4J/jceqELwcOxt5dOQG6x93EsJaAdmOE MTsaa/By+FC6S6UwCdFEKVyLuq/IAB5KqwaY/gRqen3VU7CXE5wLMfk/L4gid2mknCBO tF28yuUjWEeaqQSiAVOhvvaw62npw4tApFgyQgquK5hMtVXX5lYZAh8qs93hWC8DzK80 4Nzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ATp9hz8U; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id a21-20020a17090640d500b0096f59445af0si327490ejk.864.2023.05.25.01.16.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:16:30 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ATp9hz8U; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 9CA0D3893675 for ; Thu, 25 May 2023 08:11:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9CA0D3893675 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685002265; bh=/mcCNq8az0SKBCZ7fYdweotU1OHNPNYnoSWJj97OlQE=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=ATp9hz8UTNDO7LvlOKhoyD+FICPkZm5g0CzD7VGcNB5SbTHACSmFXzn+ulclN1D+K Lp4Fdzc+2GcL49T7Wo+skYOFVfuVobhwwsNyVzX7KGV7dnq9S8rndifC4nmG+/JU3z c5JZQNC9KryRNL1HxDe0y2BzhWE3RiRVRs1qHJlg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id B22F63857722 for ; Thu, 25 May 2023 08:05:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B22F63857722 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3078cc99232so1752546f8f.3 for ; Thu, 25 May 2023 01:05:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685001952; x=1687593952; 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=/mcCNq8az0SKBCZ7fYdweotU1OHNPNYnoSWJj97OlQE=; b=JCpkDVwYzZH8GyicjcrPXvT3xUVsPSHqK4HKtnJPeKU15ms3VBls7PRhZRZr/ckDzA n3LDQsrtvrEKP3184QJJoIjg1VqPZb0CHy2J6JBuDALJRBz4h7Iy4tYjdJEIpkEITY42 a6zS+R0mf5dGkjgEyEUOngag9+iCogi0KD5EdtLyaqDILB2CEubosHDof6Tj47D1j7gm ogGOKzm0hbm5y5tmhGhcCca8i1MJJcek1seTO6KCygIjmeFo0kFRXO+WJDQ4vwVM/Oaq x5sW3Y3U1+I0EQynKIWYG/pcWIDP6TJaBWF70CA2BjKiJWuZgIdFwmFPpKhJaheIqVKf 1Bjg== X-Gm-Message-State: AC+VfDw/H5AF1aatLjCGBKnkA39V0TD2q5jGJqMcWvOJT0xYPsCmfhEB W4myGwNwArLnB+pPoGnfuE5Zb/2TER+N5hP67b4PlQ== X-Received: by 2002:a5d:410f:0:b0:307:a36b:e7b1 with SMTP id l15-20020a5d410f000000b00307a36be7b1mr1874299wrp.5.1685001952469; Thu, 25 May 2023 01:05:52 -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 p4-20020a5d4584000000b003079693eff2sm896941wrq.41.2023.05.25.01.05.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:05:51 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Fix comments for recently added SPARK aspects Date: Thu, 25 May 2023 10:05:51 +0200 Message-Id: <20230525080551.1956531-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?1766853276592534822?= X-GMAIL-MSGID: =?utf-8?q?1766853276592534822?= From: Piotr Trojanek Implementation of contract Subprogram_Variant and Exceptional_Cases was based on the existing code for Contract_Cases, i.e. on the existing occurrences of Aspect_Contract_Cases, Name_Contract_Cases and Pragma_Contract_Cases. However, occurrences of "Contract_Cases" itself in the comments were not updated. gcc/ada/ * contracts.adb (Add_Pre_Post_Condition): Mention new aspects in the comment. * contracts.ads (Add_Contract_Item): Likewise. (Analyze_Subprogram_Body_Stub_Contract): Likewise. * sem_prag.adb (Contract_Freeze_Error): Likewise. (Ensure_Aggregate_Form): Likewise. * sem_prag.ads (Find_Related_Declaration_Or_Body): Likewise. * sinfo.ads (Is_Generic_Contract_Pragma): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/contracts.adb | 2 ++ gcc/ada/contracts.ads | 4 ++++ gcc/ada/sem_prag.adb | 18 +++++++++--------- gcc/ada/sem_prag.ads | 2 ++ gcc/ada/sinfo.ads | 2 ++ 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index c85df0fccc8..e2df8b96a65 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -223,11 +223,13 @@ package body Contracts is -- Attach_Handler -- Contract_Cases -- Depends + -- Exceptional_Cases -- Extensions_Visible -- Global -- Interrupt_Handler -- Postcondition -- Precondition + -- Subprogram_Variant -- Test_Case -- Volatile_Function diff --git a/gcc/ada/contracts.ads b/gcc/ada/contracts.ads index a53565fe003..0625b9fc029 100644 --- a/gcc/ada/contracts.ads +++ b/gcc/ada/contracts.ads @@ -45,6 +45,7 @@ package Contracts is -- Depends -- Effective_Reads -- Effective_Writes + -- Exceptional_Cases -- Extensions_Visible -- Global -- Initial_Condition @@ -58,6 +59,7 @@ package Contracts is -- Refined_Global -- Refined_Post -- Refined_States + -- Subprogram_Variant -- Test_Case -- Volatile_Function @@ -173,12 +175,14 @@ package Contracts is -- -- Contract_Cases -- Depends + -- Exceptional_Cases -- Global -- Postcondition -- Precondition -- Refined_Depends -- Refined_Global -- Refined_Post + -- Subprogram_Variant -- Test_Case procedure Analyze_Task_Contract (Task_Id : Entity_Id); diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 40636f21fc7..d66e5612135 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -225,10 +225,10 @@ package body Sem_Prag is procedure Contract_Freeze_Error (Contract_Id : Entity_Id; Freeze_Id : Entity_Id); - -- Subsidiary to the analysis of pragmas Contract_Cases, Part_Of, Post, and - -- Pre. Emit a freezing-related error message where Freeze_Id is the entity - -- of a body which caused contract freezing and Contract_Id denotes the - -- entity of the affected contstruct. + -- Subsidiary to the analysis of pragmas Contract_Cases, Exceptional_Cases, + -- Part_Of, Post, Pre and Subprogram_Variant. Emit a freezing-related error + -- message where Freeze_Id is the entity of a body which caused contract + -- freezing and Contract_Id denotes the entity of the affected contstruct. procedure Duplication_Error (Prag : Node_Id; Prev : Node_Id); -- Subsidiary to all Find_Related_xxx routines. Emit an error on pragma @@ -4515,11 +4515,11 @@ package body Sem_Prag is procedure Ensure_Aggregate_Form (Arg : Node_Id); -- Subsidiary routine to the processing of pragmas Abstract_State, - -- Contract_Cases, Depends, Global, Initializes, Refined_Depends, - -- Refined_Global, Refined_State and Subprogram_Variant. Transform - -- argument Arg into an aggregate if not one already. N_Null is never - -- transformed. Arg may denote an aspect specification or a pragma - -- argument association. + -- Contract_Cases, Depends, Exceptional_Cases, Global, Initializes, + -- Refined_Depends, Refined_Global, Refined_State and + -- Subprogram_Variant. Transform argument Arg into an aggregate if not + -- one already. N_Null is never transformed. Arg may denote an aspect + -- specification or a pragma argument association. procedure Error_Pragma (Msg : String); pragma No_Return (Error_Pragma); diff --git a/gcc/ada/sem_prag.ads b/gcc/ada/sem_prag.ads index cbeb815ee0e..49c1d0b4892 100644 --- a/gcc/ada/sem_prag.ads +++ b/gcc/ada/sem_prag.ads @@ -447,6 +447,7 @@ package Sem_Prag is -- Subsidiary to the analysis of pragmas -- Contract_Cases -- Depends + -- Exceptional_Cases -- Extensions_Visible -- Global -- Initializes @@ -463,6 +464,7 @@ package Sem_Prag is -- Refined_Global -- Refined_Post -- Refined_State + -- Subprogram_Variant -- Test_Case -- Volatile_Function -- as well as attributes 'Old and 'Result. Find the declaration of the diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index e6a27e62cc1..e4fd6794f4b 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -1712,6 +1712,7 @@ package Sinfo is -- Abstract_State -- Contract_Cases -- Depends + -- Exceptional_Cases -- Extensions_Visible -- Global -- Initial_Condition @@ -1726,6 +1727,7 @@ package Sinfo is -- Refined_Global -- Refined_Post -- Refined_State + -- Subprogram_Variant -- Test_Case -- Is_Homogeneous_Aggregate