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: 60592 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 183523858D20 for ; Mon, 14 Nov 2022 13:54:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 183523858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668434084; bh=cG9HKvSbrBekQWyH8hAWWzVei23CH6hp70ZryrSxhfc=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=LMysNBXkfVlSwhnmLH3++GmHrJJRuF+W6nDct9p9qqqJngditIklU8QyJIoIIq+5e +lL4HqkAhQdEPUXFWqMBBJL5QAdKvllvDv6IF0MSMbYHF5brw8g0ctqxDvvdvp4E52 Ba9V7/zwz/mF5NIxTtBfgWMl/2ISr1kZXyFT/zJM= 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-Google-Smtp-Source: AA0mqf6v7Pl7gSIbI8VomFerdnOr7cJ2ACnHCtXlX+ZKRNB4a3taQQsFtQbqKpixn72v8JoGa2Ibbg== 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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