From patchwork Wed Sep 22 15:16:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 1531308 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=cc6w8P20; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HF2Yz56gyz9sP7 for ; Thu, 23 Sep 2021 01:40:39 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BC0533858422 for ; Wed, 22 Sep 2021 15:40:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC0533858422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1632325236; bh=dttI8ie/lbB3tNHJCO10yDkFPdpB7fmRUqgmzvAl804=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=cc6w8P20LApBlVI1AHTF7YqyCw9qa+Rm6UAU30TD4CAQthVblPCSW+WSdvrrKgWHy RvMn4vu9wogmVrDPv2Im9QRSuWNaJi4RjUR2pHaw/Uffa33CoCgRoOuAuFf37GN6W5 Hq5JuWdx1NIYJhCpA2UX7P1CFB4nncRWPcAyXcHs= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id AFA643858D39 for ; Wed, 22 Sep 2021 15:16:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AFA643858D39 Received: by mail-wr1-x42e.google.com with SMTP id u15so7887426wru.6 for ; Wed, 22 Sep 2021 08:16:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=dttI8ie/lbB3tNHJCO10yDkFPdpB7fmRUqgmzvAl804=; b=aRE+UoXqdutTC/rWMeS3JVh7dVwvE411WkTUdvFRi3mJJ7ojTUt6fmrG6Qgusdp3qS MZpylIQEweXekPW5/eHo/23mAbPy9AG4CcfkQmIriAAITYvf9528wvI1BNHBo4wE9YJR DmHYwXvh2LgSs4mn2jKhcyTDsGHfrudQhMmrPRpx46RnGEWLIICqk1rRonhkq8Az5jeu eqQC3u0J9LJ58QmOV9PE0NHaRSdKNlGG3w6wSQF5xPy6IQ4DJgyF0LoHaXI/aTv21Jz3 AyclLpZGrVmKo9dIN2OEpsyo4ChfcNZc3pNDp5Hq8mF3KMBBwrGTaPwOm97u8A+s/PQr C0vg== X-Gm-Message-State: AOAM530VLCKNSDVJ8rnOSdq3PoY2RFkvCKC8SVowPViTJC46jG1gaBTI Nw08bAqHqodH0WeJXHDxutOzMkvDqkrHzQ== X-Google-Smtp-Source: ABdhPJyFhSr3MY2uqChCjpVc+iJz2Z9Xi2Zww07h9QZFI/200wJpwhO4JxALBU7R+ngXJCG1zZLcCQ== X-Received: by 2002:a1c:7503:: with SMTP id o3mr10991542wmc.129.1632323769798; Wed, 22 Sep 2021 08:16:09 -0700 (PDT) Received: from adacore.com ([2a02:2ab8:224:2ce:72b5:e8ff:feef:ee60]) by smtp.gmail.com with ESMTPSA id t18sm1186041wrv.39.2021.09.22.08.16.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 08:16:09 -0700 (PDT) Date: Wed, 22 Sep 2021 15:16:08 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Fix conformance errors and erroneous code Message-ID: <20210922151608.GA1908152@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-12.6 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Pierre-Marie de Rodat via Gcc-patches From: Pierre-Marie de Rodat Reply-To: Pierre-Marie de Rodat Cc: Bob Duff Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This patch fixes many cases where a formal parameter is declared as Node_Id on the spec, and Entity_Id on the body (and similar), which is illegal according to the conformance rules. It also removes some erroneous pragmas Suppress, and initializes the uninitialized variables that were being read. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * contracts.adb, einfo-utils.adb, einfo-utils.ads, exp_ch7.adb, exp_ch9.adb, exp_disp.adb, exp_prag.adb, exp_smem.adb, exp_util.adb, freeze.adb, sem_aggr.adb, sem_attr.adb, sem_ch8.adb, sem_prag.ads, sem_util.adb, sem_util.ads: Fix conformance errors. * errout.adb, erroutc.adb: Remove pragmas Suppress. * err_vars.ads: Initialize variables that were previously being read uninitialized. diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -3440,7 +3440,7 @@ package body Contracts is -- Get_Postcond_Enabled -- -------------------------- - function Get_Postcond_Enabled (Subp : Entity_Id) return Node_Id is + function Get_Postcond_Enabled (Subp : Entity_Id) return Entity_Id is Decl : Node_Id; begin Decl := @@ -3465,7 +3465,7 @@ package body Contracts is ------------------------------------ function Get_Result_Object_For_Postcond - (Subp : Entity_Id) return Node_Id + (Subp : Entity_Id) return Entity_Id is Decl : Node_Id; begin @@ -3490,7 +3490,7 @@ package body Contracts is -- Get_Return_Success_For_Postcond -- ------------------------------------- - function Get_Return_Success_For_Postcond (Subp : Entity_Id) return Node_Id + function Get_Return_Success_For_Postcond (Subp : Entity_Id) return Entity_Id is Decl : Node_Id; begin diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb --- a/gcc/ada/einfo-utils.adb +++ b/gcc/ada/einfo-utils.adb @@ -701,7 +701,7 @@ package body Einfo.Utils is -- Entry_Index_Type -- ---------------------- - function Entry_Index_Type (Id : E) return N is + function Entry_Index_Type (Id : E) return E is begin pragma Assert (Ekind (Id) = E_Entry_Family); return Etype (Discrete_Subtype_Definition (Parent (Id))); @@ -1745,7 +1745,7 @@ package body Einfo.Utils is -- Link_Entities -- ------------------- - procedure Link_Entities (First : Entity_Id; Second : Node_Id) is + procedure Link_Entities (First, Second : Entity_Id) is begin if Present (Second) then Set_Prev_Entity (Second, First); -- First <-- Second diff --git a/gcc/ada/einfo-utils.ads b/gcc/ada/einfo-utils.ads --- a/gcc/ada/einfo-utils.ads +++ b/gcc/ada/einfo-utils.ads @@ -625,7 +625,7 @@ package Einfo.Utils is -- WARNING: There is a matching C declaration of this subprogram in fe.h - procedure Link_Entities (First : Entity_Id; Second : Entity_Id); + procedure Link_Entities (First, Second : Entity_Id); -- Link entities First and Second in one entity chain. -- -- NOTE: No updates are done to the First_Entity and Last_Entity fields diff --git a/gcc/ada/err_vars.ads b/gcc/ada/err_vars.ads --- a/gcc/ada/err_vars.ads +++ b/gcc/ada/err_vars.ads @@ -105,12 +105,15 @@ package Err_Vars is -- of the following global variables to appropriate values before making a -- call to one of the error message routines with a string containing the -- insertion character to get the value inserted in an appropriate format. + -- + -- Some of these are initialized below, because they are read before being + -- set by clients. Error_Msg_Col : Column_Number; -- Column for @ insertion character in message Error_Msg_Uint_1 : Uint; - Error_Msg_Uint_2 : Uint; + Error_Msg_Uint_2 : Uint := No_Uint; -- Uint values for ^ insertion characters in message -- WARNING: There is a matching C declaration of these variables in fe.h @@ -119,21 +122,21 @@ package Err_Vars is -- Source location for # insertion character in message Error_Msg_Name_1 : Name_Id; - Error_Msg_Name_2 : Name_Id; - Error_Msg_Name_3 : Name_Id; + Error_Msg_Name_2 : Name_Id := No_Name; + Error_Msg_Name_3 : Name_Id := No_Name; -- Name_Id values for % insertion characters in message Error_Msg_File_1 : File_Name_Type; - Error_Msg_File_2 : File_Name_Type; - Error_Msg_File_3 : File_Name_Type; + Error_Msg_File_2 : File_Name_Type := No_File; + Error_Msg_File_3 : File_Name_Type := No_File; -- File_Name_Type values for { insertion characters in message Error_Msg_Unit_1 : Unit_Name_Type; - Error_Msg_Unit_2 : Unit_Name_Type; + Error_Msg_Unit_2 : Unit_Name_Type := No_Unit_Name; -- Unit_Name_Type values for $ insertion characters in message Error_Msg_Node_1 : Node_Id; - Error_Msg_Node_2 : Node_Id; + Error_Msg_Node_2 : Node_Id := Empty; -- Node_Id values for & insertion characters in message Error_Msg_Warn : Boolean; diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -3602,15 +3602,9 @@ package body Errout is end if; -- The following assignment ensures that a second ampersand insertion - -- character will correspond to the Error_Msg_Node_2 parameter. We - -- suppress possible validity checks in case operating in -gnatVa mode, - -- and Error_Msg_Node_2 is not needed and has not been set. + -- character will correspond to the Error_Msg_Node_2 parameter. - declare - pragma Suppress (Range_Check); - begin - Error_Msg_Node_1 := Error_Msg_Node_2; - end; + Error_Msg_Node_1 := Error_Msg_Node_2; end Set_Msg_Insertion_Node; -------------------------------------- @@ -3790,15 +3784,9 @@ package body Errout is end if; -- The following assignment ensures that a second percent insertion - -- character will correspond to the Error_Msg_Unit_2 parameter. We - -- suppress possible validity checks in case operating in -gnatVa mode, - -- and Error_Msg_Unit_2 is not needed and has not been set. + -- character will correspond to the Error_Msg_Unit_2 parameter. - declare - pragma Suppress (Range_Check); - begin - Error_Msg_Unit_1 := Error_Msg_Unit_2; - end; + Error_Msg_Unit_1 := Error_Msg_Unit_2; end Set_Msg_Insertion_Unit_Name; ------------------ diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb --- a/gcc/ada/erroutc.adb +++ b/gcc/ada/erroutc.adb @@ -1119,17 +1119,11 @@ package body Erroutc is end if; -- The following assignments ensure that the second and third { - -- insertion characters will correspond to the Error_Msg_File_2 and - -- Error_Msg_File_3 values and We suppress possible validity checks in - -- case operating in -gnatVa mode, and Error_Msg_File_2 or - -- Error_Msg_File_3 is not needed and has not been set. + -- insertion characters will correspond to the Error_Msg_File_2 + -- and Error_Msg_File_3 values. - declare - pragma Suppress (Range_Check); - begin - Error_Msg_File_1 := Error_Msg_File_2; - Error_Msg_File_2 := Error_Msg_File_3; - end; + Error_Msg_File_1 := Error_Msg_File_2; + Error_Msg_File_2 := Error_Msg_File_3; end Set_Msg_Insertion_File_Name; ----------------------------------- @@ -1299,16 +1293,10 @@ package body Erroutc is -- The following assignments ensure that the second and third percent -- insertion characters will correspond to the Error_Msg_Name_2 and - -- Error_Msg_Name_3 as required. We suppress possible validity checks in - -- case operating in -gnatVa mode, and Error_Msg_Name_1/2 is not needed - -- and has not been set. + -- Error_Msg_Name_3 as required. - declare - pragma Suppress (Range_Check); - begin - Error_Msg_Name_1 := Error_Msg_Name_2; - Error_Msg_Name_2 := Error_Msg_Name_3; - end; + Error_Msg_Name_1 := Error_Msg_Name_2; + Error_Msg_Name_2 := Error_Msg_Name_3; end Set_Msg_Insertion_Name; ------------------------------------ @@ -1334,16 +1322,10 @@ package body Erroutc is -- The following assignments ensure that the second and third % or %% -- insertion characters will correspond to the Error_Msg_Name_2 and - -- Error_Msg_Name_3 values and We suppress possible validity checks in - -- case operating in -gnatVa mode, and Error_Msg_Name_2 or - -- Error_Msg_Name_3 is not needed and has not been set. + -- Error_Msg_Name_3 values. - declare - pragma Suppress (Range_Check); - begin - Error_Msg_Name_1 := Error_Msg_Name_2; - Error_Msg_Name_2 := Error_Msg_Name_3; - end; + Error_Msg_Name_1 := Error_Msg_Name_2; + Error_Msg_Name_2 := Error_Msg_Name_3; end Set_Msg_Insertion_Name_Literal; ------------------------------------- @@ -1427,15 +1409,9 @@ package body Erroutc is end loop; -- The following assignment ensures that a second caret insertion - -- character will correspond to the Error_Msg_Uint_2 parameter. We - -- suppress possible validity checks in case operating in -gnatVa mode, - -- and Error_Msg_Uint_2 is not needed and has not been set. + -- character will correspond to the Error_Msg_Uint_2 parameter. - declare - pragma Suppress (Range_Check); - begin - Error_Msg_Uint_1 := Error_Msg_Uint_2; - end; + Error_Msg_Uint_1 := Error_Msg_Uint_2; end Set_Msg_Insertion_Uint; ----------------- diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -486,11 +486,11 @@ package body Exp_Ch7 is function Make_Deep_Proc (Prim : Final_Primitives; Typ : Entity_Id; - Stmts : List_Id) return Node_Id; + Stmts : List_Id) return Entity_Id; -- This function generates the tree for Deep_Initialize, Deep_Adjust or - -- Deep_Finalize procedures according to the first parameter, these - -- procedures operate on the type Typ. The Stmts parameter gives the body - -- of the procedure. + -- Deep_Finalize procedures according to the first parameter. These + -- procedures operate on the type Typ. The Stmts parameter gives the + -- body of the procedure. function Make_Deep_Array_Body (Prim : Final_Primitives; diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -145,7 +145,7 @@ package body Exp_Ch9 is function Build_Corresponding_Record (N : Node_Id; - Ctyp : Node_Id; + Ctyp : Entity_Id; Loc : Source_Ptr) return Node_Id; -- Common to tasks and protected types. Copy discriminant specifications, -- build record declaration. N is the type declaration, Ctyp is the @@ -1583,9 +1583,9 @@ package body Exp_Ch9 is -------------------------------- function Build_Corresponding_Record - (N : Node_Id; - Ctyp : Entity_Id; - Loc : Source_Ptr) return Node_Id + (N : Node_Id; + Ctyp : Entity_Id; + Loc : Source_Ptr) return Node_Id is Rec_Ent : constant Entity_Id := Make_Defining_Identifier @@ -14867,7 +14867,7 @@ package body Exp_Ch9 is Actuals : List_Id; Formals : List_Id; Decls : List_Id; - Stmts : List_Id) return Node_Id + Stmts : List_Id) return Entity_Id is Actual : Entity_Id; Expr : Node_Id := Empty; diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -348,7 +348,7 @@ package body Exp_Disp is -- Build_Static_Dispatch_Tables -- ---------------------------------- - procedure Build_Static_Dispatch_Tables (N : Entity_Id) is + procedure Build_Static_Dispatch_Tables (N : Node_Id) is Target_List : List_Id; procedure Build_Dispatch_Tables (List : List_Id); diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb --- a/gcc/ada/exp_prag.adb +++ b/gcc/ada/exp_prag.adb @@ -752,10 +752,10 @@ package body Exp_Prag is -- value of which is Init_Val if present or null if not. function Build_Simple_Declaration_With_Default - (Decl_Id : Entity_Id; - Init_Val : Entity_Id; - Typ : Entity_Id; - Default_Val : Entity_Id) return Node_Id; + (Decl_Id : Entity_Id; + Init_Val : Node_Id; + Typ : Node_Id; + Default_Val : Node_Id) return Node_Id; -- Build a declaration the Defining_Identifier of which is Decl_Id, the -- Object_Definition of which is Typ, the value of which is Init_Val if -- present or Default otherwise. @@ -983,7 +983,7 @@ package body Exp_Prag is function Build_Simple_Declaration_With_Default (Decl_Id : Entity_Id; Init_Val : Node_Id; - Typ : Entity_Id; + Typ : Node_Id; Default_Val : Node_Id) return Node_Id is Value : Node_Id := Init_Val; @@ -2862,7 +2862,7 @@ package body Exp_Prag is procedure Expand_Pragma_Subprogram_Variant (Prag : Node_Id; - Subp_Id : Node_Id; + Subp_Id : Entity_Id; Body_Decls : List_Id) is Curr_Decls : List_Id; diff --git a/gcc/ada/exp_smem.adb b/gcc/ada/exp_smem.adb --- a/gcc/ada/exp_smem.adb +++ b/gcc/ada/exp_smem.adb @@ -86,7 +86,7 @@ package body Exp_Smem is function Build_Shared_Var_Proc_Call (Loc : Source_Ptr; - E : Node_Id; + E : Entity_Id; N : Name_Id) return Node_Id; -- Build a call to support procedure N for shared object E (provided by the -- instance of System.Shared_Storage.Shared_Var_Procs associated to E). diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -4914,7 +4914,7 @@ package body Exp_Util is -- Convert_To_Actual_Subtype -- ------------------------------- - procedure Convert_To_Actual_Subtype (Exp : Entity_Id) is + procedure Convert_To_Actual_Subtype (Exp : Node_Id) is Act_ST : Entity_Id; begin @@ -7048,7 +7048,7 @@ package body Exp_Util is -- Get_Index_Subtype -- ----------------------- - function Get_Index_Subtype (N : Node_Id) return Node_Id is + function Get_Index_Subtype (N : Node_Id) return Entity_Id is P_Type : Entity_Id := Etype (Prefix (N)); Indx : Node_Id; J : Int; diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -284,11 +284,11 @@ package body Freeze is -- Full_View or Corresponding_Record_Type. procedure Warn_Overlay (Expr : Node_Id; Typ : Entity_Id; Nam : Node_Id); - -- Expr is the expression for an address clause for entity Nam whose type - -- is Typ. If Typ has a default initialization, and there is no explicit - -- initialization in the source declaration, check whether the address - -- clause might cause overlaying of an entity, and emit a warning on the - -- side effect that the initialization will cause. + -- Expr is the expression for an address clause for the entity denoted by + -- Nam whose type is Typ. If Typ has a default initialization, and there is + -- no explicit initialization in the source declaration, check whether the + -- address clause might cause overlaying of an entity, and emit a warning + -- on the side effect that the initialization will cause. ------------------------------- -- Adjust_Esize_For_Alignment -- @@ -10081,7 +10081,7 @@ package body Freeze is -- Warn_Overlay -- ------------------ - procedure Warn_Overlay (Expr : Node_Id; Typ : Entity_Id; Nam : Entity_Id) is + procedure Warn_Overlay (Expr : Node_Id; Typ : Entity_Id; Nam : Node_Id) is Ent : constant Entity_Id := Entity (Nam); -- The object to which the address clause applies 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 @@ -365,7 +365,7 @@ package body Sem_Aggr is -- to the expansion phase. As an optimization, if the discrete choice -- specifies a single value we do not delay resolution. - function Array_Aggr_Subtype (N : Node_Id; Typ : Node_Id) return Entity_Id; + function Array_Aggr_Subtype (N : Node_Id; Typ : Entity_Id) return Entity_Id; -- This routine returns the type or subtype of an array aggregate. -- -- N is the array aggregate node whose type we return. diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -12469,7 +12469,7 @@ package body Sem_Attr is function Stream_Attribute_Available (Typ : Entity_Id; Nam : TSS_Name_Type; - Partial_View : Node_Id := Empty) return Boolean + Partial_View : Entity_Id := Empty) return Boolean is Etyp : Entity_Id := Typ; diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -426,12 +426,10 @@ package body Sem_Ch8 is -- body at the point of freezing will not work. Subp is the subprogram -- for which N provides the Renaming_As_Body. - procedure Check_In_Previous_With_Clause - (N : Node_Id; - Nam : Node_Id); + procedure Check_In_Previous_With_Clause (N, Nam : Node_Id); -- N is a use_package clause and Nam the package name, or N is a use_type -- clause and Nam is the prefix of the type name. In either case, verify - -- that the package is visible at that point in the context: either it + -- that the package is visible at that point in the context: either it -- appears in a previous with_clause, or because it is a fully qualified -- name and the root ancestor appears in a previous with_clause. @@ -4670,10 +4668,7 @@ package body Sem_Ch8 is -- Check_In_Previous_With_Clause -- ----------------------------------- - procedure Check_In_Previous_With_Clause - (N : Node_Id; - Nam : Entity_Id) - is + procedure Check_In_Previous_With_Clause (N, Nam : Node_Id) is Pack : constant Entity_Id := Entity (Original_Node (Nam)); Item : Node_Id; Par : Node_Id; diff --git a/gcc/ada/sem_prag.ads b/gcc/ada/sem_prag.ads --- a/gcc/ada/sem_prag.ads +++ b/gcc/ada/sem_prag.ads @@ -429,7 +429,7 @@ package Sem_Prag is function Get_Argument (Prag : Node_Id; - Context_Id : Node_Id := Empty) return Node_Id; + Context_Id : Entity_Id := Empty) return Node_Id; -- Obtain the argument of pragma Prag depending on context and the nature -- of the pragma. The argument is extracted in the following manner: -- diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -24709,7 +24709,7 @@ package body Sem_Util is -- Visit_Node -- ---------------- - procedure Visit_Node (N : Node_Or_Entity_Id) is + procedure Visit_Node (N : Node_Id) is begin pragma Assert (Nkind (N) not in N_Entity); diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -356,7 +356,7 @@ package Sem_Util is -- carries the name of the reference discriminant. function Build_Overriding_Spec - (Op : Node_Id; + (Op : Entity_Id; Typ : Entity_Id) return Node_Id; -- Build a subprogram specification for the wrapper of an inherited -- operation with a modified pre- or postcondition (See AI12-0113).