From patchwork Mon Nov 14 13:52:08 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: 19823 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2157233wru; Mon, 14 Nov 2022 05:58:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Mjrgvxwilyhwj0qakFhPBwoQX+MvEEK0uUT5r0wMDsRQDTC+4rNEaZwBFkNeXTgn/Kce6 X-Received: by 2002:a17:906:4e16:b0:7ae:72ae:1f85 with SMTP id z22-20020a1709064e1600b007ae72ae1f85mr9877547eju.133.1668434295385; Mon, 14 Nov 2022 05:58:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668434295; cv=none; d=google.com; s=arc-20160816; b=C9M95hGSC6P5WbqJdydZa7rLnGLpJta3ozy+fWou/fMkSgRYpSBftWaSC2vczTSzBb qiKtdIocBWKMJk4itNTXwl9kfWC4uvn6Xw1wP2tx3aef18iHzbF2iUkGci4iTx2pBjFe OvUrIreaglJ9uJTJCB1tylCsExxYUUaXmV1BRDC7HXOYx9+6ME3vwshflLj76vALcFig 9FIKCMgPYaK3SlqHxMbdbIPv96bUlmzNGZIvH9aW+57+7OHb6HfbMBR2CmGIP+KLOHR3 90honohp+4mB+jbvwmCEaOjixe23WG3+PsquXnLVX3RqcclDYnA3d2T+3h60Ro9loxk7 Wlxw== 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=cG9HKvSbrBekQWyH8hAWWzVei23CH6hp70ZryrSxhfc=; b=Xzy7U2uwuleMEJLQdVascV3TmbeUYFCAJiVQtluqyglIRy7eU1NvXoQtvsSk1Czz77 4vePMKW0kbK3IBIth5fwgA7YxorRseR5pQxgGV/H4+8Swe3z1uUu5tuYxk0wF+UJWO7p h4/KdFslx6QjbRLhiv03btiWoZZs+wRgECCXIKqXuNhR3bAUqUX2pI2EdqzGJRWgWXhM xe+iDUW54TnhCBlDHEocqruZELORhtWFsnVEJGK4D4P+r3tUuFSEHa4FFemGZB5oku7f Ikb0DDzvMh57hN50cpKiB57ulGLqSMa4SqWFzXKJI39z+BoFHvGRT8B7VFLdGRS0FtuL EhuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=A3GdJ1mk; 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 p27-20020a1709066a9b00b00781e6ba94ffsi7136354ejr.126.2022.11.14.05.58.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 05:58:15 -0800 (PST) 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=A3GdJ1mk; 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 9659E388B6A5 for ; Mon, 14 Nov 2022 13:54:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9659E388B6A5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668434099; bh=cG9HKvSbrBekQWyH8hAWWzVei23CH6hp70ZryrSxhfc=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=A3GdJ1mkgzJRMGjkSVsQfKffuh2dO03KxoxjBRFfw+UbT5BprupR0osSvfToK8W5O 4L5nLnnhp2dSsE6g+2PVjS/gxJLNTX/wpQXazyRD7zCX4FJMccvqX5ff5LVJouRvVK mCuGq+0LYH8e19JUy1RDgMCNn/WH18Kl/R6lhZyE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 4068A3858C2C for ; Mon, 14 Nov 2022 13:52:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4068A3858C2C Received: by mail-wm1-x32f.google.com with SMTP id i186-20020a1c3bc3000000b003cfe29a5733so871248wma.3 for ; Mon, 14 Nov 2022 05:52:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=cG9HKvSbrBekQWyH8hAWWzVei23CH6hp70ZryrSxhfc=; b=efNGiyp7EY6MojuVObNpQdPG6306mJRIGsZyBIPD/WTppo0XqjhBGMVk4XqjMSbV8M ew25gYS6F2sr2JzGjRzNEAhoenXOplljMozJzDlyyXOrJNDUdQAy2Sycat+rirZ90VPs kRNTYToOY102ROCRrnQktrkAmsiLIIa1tUlUTd/dzCbz7MFlzIYvTWL6HFPdyIDWw7gq 9g3EC8aegsr/heBqn6KxQV4zuZtzU/KaU9E2EFnzW9335fz2l1YjV03aFjwUd6QAdR4V WAcvCAtsFhDmQbTS2c7N9NMQ52DHkH+oCboK5/qGCs5YiUxGVFk2W14cw83tumYjWaGm Vk6w== X-Gm-Message-State: ANoB5plhXqXQ/MxVaqIKu0whQX+ZHCViK5R5G8iiyBfxFm3vE3QvitxO YjtFicfAL5/h2AgMRV1d9CqUo3CZ/BDIBA== X-Received: by 2002:a1c:f617:0:b0:3cf:ade4:d529 with SMTP id w23-20020a1cf617000000b003cfade4d529mr8135280wmc.193.1668433930960; Mon, 14 Nov 2022 05:52:10 -0800 (PST) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id m6-20020a05600c4f4600b003c6cd82596esm19750717wmq.43.2022.11.14.05.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 05:52:10 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Fix style in code for generic formal subprograms with contracts Date: Mon, 14 Nov 2022 14:52:08 +0100 Message-Id: <20221114135208.52775-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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?1749480160065993610?= X-GMAIL-MSGID: =?utf-8?q?1749480160065993610?= From: Piotr Trojanek Code cleanup related to expansion generic formal subprograms with contracts for GNATprove. gcc/ada/ * inline.adb (Replace_Formal): Tune whitespace. * sem_ch12.adb (Check_Overloaded_Formal_Subprogram): Refine type of a formal parameter and local variable; this routine operates on nodes and not entities. * sem_ch12.ads: Tune whitespace. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/inline.adb | 4 ++-- gcc/ada/sem_ch12.adb | 18 +++++++++--------- gcc/ada/sem_ch12.ads | 18 +++++++++--------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index a1ead98e67a..d33f5b4558e 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -4723,8 +4723,8 @@ package body Inline is -------------------- function Replace_Formal (N : Node_Id) return Traverse_Result is - A : Entity_Id; - E : Entity_Id; + A : Entity_Id; + E : Entity_Id; begin if Is_Entity_Name (N) and then Present (Entity (N)) then diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 7af365e49c9..03ce5d51a03 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -1151,7 +1151,7 @@ package body Sem_Ch12 is -- in which case the predefined operations will be used. This merits -- a warning because of the special semantics of fixed point ops. - procedure Check_Overloaded_Formal_Subprogram (Formal : Entity_Id); + procedure Check_Overloaded_Formal_Subprogram (Formal : Node_Id); -- Apply RM 12.3(9): if a formal subprogram is overloaded, the instance -- cannot have a named association for it. AI05-0025 extends this rule -- to formals of formal packages by AI05-0025, and it also applies to @@ -1259,15 +1259,15 @@ package body Sem_Ch12 is -- actuals. Append_To (Assoc_List, - Build_Subprogram_Body_Wrapper (Formal, Actual_Name)); + Build_Subprogram_Body_Wrapper (Formal, Actual_Name)); end Build_Subprogram_Wrappers; ---------------------------------------- -- Check_Overloaded_Formal_Subprogram -- ---------------------------------------- - procedure Check_Overloaded_Formal_Subprogram (Formal : Entity_Id) is - Temp_Formal : Entity_Id; + procedure Check_Overloaded_Formal_Subprogram (Formal : Node_Id) is + Temp_Formal : Node_Id; begin Temp_Formal := First (Formals); @@ -1449,8 +1449,8 @@ package body Sem_Ch12 is (F : Entity_Id; A_F : Entity_Id) return Node_Id is - Prev : Node_Id; - Act : Node_Id; + Prev : Node_Id; + Act : Node_Id; begin Is_Named_Assoc := False; @@ -6252,7 +6252,7 @@ package body Sem_Ch12 is while Present (Act) loop Append_To (Actuals, - Make_Identifier (Loc, Chars (Defining_Identifier (Act)))); + Make_Identifier (Loc, Chars (Defining_Identifier (Act)))); Next (Act); end loop; @@ -6273,8 +6273,8 @@ package body Sem_Ch12 is Specification => Spec_Node, Declarations => New_List, Handled_Statement_Sequence => - Make_Handled_Sequence_Of_Statements (Loc, - Statements => New_List (Stmt))); + Make_Handled_Sequence_Of_Statements (Loc, + Statements => New_List (Stmt))); return Body_Node; end Build_Subprogram_Body_Wrapper; diff --git a/gcc/ada/sem_ch12.ads b/gcc/ada/sem_ch12.ads index 58a94552991..69c9d6404e6 100644 --- a/gcc/ada/sem_ch12.ads +++ b/gcc/ada/sem_ch12.ads @@ -27,15 +27,15 @@ with Inline; use Inline; with Types; use Types; package Sem_Ch12 is - procedure Analyze_Generic_Package_Declaration (N : Node_Id); - procedure Analyze_Generic_Subprogram_Declaration (N : Node_Id); - procedure Analyze_Package_Instantiation (N : Node_Id); - procedure Analyze_Procedure_Instantiation (N : Node_Id); - procedure Analyze_Function_Instantiation (N : Node_Id); - procedure Analyze_Formal_Object_Declaration (N : Node_Id); - procedure Analyze_Formal_Type_Declaration (N : Node_Id); - procedure Analyze_Formal_Subprogram_Declaration (N : Node_Id); - procedure Analyze_Formal_Package_Declaration (N : Node_Id); + procedure Analyze_Generic_Package_Declaration (N : Node_Id); + procedure Analyze_Generic_Subprogram_Declaration (N : Node_Id); + procedure Analyze_Package_Instantiation (N : Node_Id); + procedure Analyze_Procedure_Instantiation (N : Node_Id); + procedure Analyze_Function_Instantiation (N : Node_Id); + procedure Analyze_Formal_Object_Declaration (N : Node_Id); + procedure Analyze_Formal_Type_Declaration (N : Node_Id); + procedure Analyze_Formal_Subprogram_Declaration (N : Node_Id); + procedure Analyze_Formal_Package_Declaration (N : Node_Id); procedure Start_Generic; -- Must be invoked before starting to process a generic spec or body