From 1985767d6517bd8daa0625f3923e24f0861f68b8 Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Mon, 11 Jun 2018 09:19:40 +0000 Subject: [PATCH] [Ada] Minor reformatting 2018-06-11 Hristian Kirtchev gcc/ada/ * exp_ch9.adb, exp_unst.adb, inline.adb, libgnat/a-ciorma.adb, libgnat/a-ciormu.adb, libgnat/a-ciorse.adb, libgnat/a-coorma.adb, libgnat/a-coormu.adb, libgnat/a-coorse.adb, sem_prag.adb: Minor reformatting. From-SVN: r261429 --- gcc/ada/ChangeLog | 7 +++ gcc/ada/exp_ch9.adb | 5 ++- gcc/ada/exp_unst.adb | 85 ++++++++++++++++++------------------ gcc/ada/inline.adb | 4 +- gcc/ada/libgnat/a-ciorma.adb | 7 +-- gcc/ada/libgnat/a-ciormu.adb | 7 +-- gcc/ada/libgnat/a-ciorse.adb | 7 +-- gcc/ada/libgnat/a-coorma.adb | 7 +-- gcc/ada/libgnat/a-coormu.adb | 7 +-- gcc/ada/libgnat/a-coorse.adb | 7 +-- gcc/ada/sem_prag.adb | 10 ++--- 11 files changed, 84 insertions(+), 69 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1edc46228f2..bb72af025e3 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2018-06-11 Hristian Kirtchev + + * exp_ch9.adb, exp_unst.adb, inline.adb, libgnat/a-ciorma.adb, + libgnat/a-ciormu.adb, libgnat/a-ciorse.adb, libgnat/a-coorma.adb, + libgnat/a-coormu.adb, libgnat/a-coorse.adb, sem_prag.adb: Minor + reformatting. + 2018-06-11 Gary Dismukes * exp_unst.ads, exp_unst.adb: Typo fixes and minor reformatting. diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 7cb5068f12b..ea03fe219a9 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -8653,8 +8653,9 @@ package body Exp_Ch9 is when N_Implicit_Label_Declaration => null; - when N_Call_Marker | - N_Itype_Reference => + when N_Call_Marker + | N_Itype_Reference + => New_Op_Body := New_Copy (Op_Body); Insert_After (Current_Node, New_Op_Body); Current_Node := New_Op_Body; diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index b38acadd563..1ac96364345 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -99,14 +99,9 @@ package body Exp_Unst is -- table already contains this entry and if so it has no effect. ---------------------------------- - -- subprograms for fat pointers -- + -- Subprograms For Fat Pointers -- ---------------------------------- - function Needs_Fat_Pointer (E : Entity_Id) return Boolean; - -- A formal parameter of an unconstrained array type that appears in - -- an uplevel reference requires the construction of an access type, - -- to be used in the corresponding component declaration. - function Build_Access_Type_Decl (E : Entity_Id; Scop : Entity_Id) return Node_Id; @@ -115,6 +110,11 @@ package body Exp_Unst is -- record component. The relevant attributes of the access type are -- set here to avoid a full analysis that would require a scope stack. + function Needs_Fat_Pointer (E : Entity_Id) return Boolean; + -- A formal parameter of an unconstrained array type that appears in an + -- uplevel reference requires the construction of an access type, to be + -- used in the corresponding component declaration. + ----------- -- Urefs -- ----------- @@ -169,17 +169,6 @@ package body Exp_Unst is Calls.Append (Call); end Append_Unique_Call; - ----------------------- - -- Needs_Fat_Pointer -- - ----------------------- - - function Needs_Fat_Pointer (E : Entity_Id) return Boolean is - begin - return Is_Formal (E) - and then Is_Array_Type (Etype (E)) - and then not Is_Constrained (Etype (E)); - end Needs_Fat_Pointer; - ----------------------------- -- Build_Access_Type_Decl -- ----------------------------- @@ -188,9 +177,8 @@ package body Exp_Unst is (E : Entity_Id; Scop : Entity_Id) return Node_Id is - Loc : constant Source_Ptr := Sloc (E); - Decl : Node_Id; - Typ : Entity_Id; + Loc : constant Source_Ptr := Sloc (E); + Typ : Entity_Id; begin Typ := Make_Temporary (Loc, 'S'); @@ -199,12 +187,12 @@ package body Exp_Unst is Set_Scope (Typ, Scop); Set_Directly_Designated_Type (Typ, Etype (E)); - Decl := Make_Full_Type_Declaration (Loc, - Defining_Identifier => Typ, - Type_Definition => Make_Access_To_Object_Definition (Loc, - Subtype_Indication => New_Occurrence_Of (Etype (E), Loc))); - - return Decl; + return + Make_Full_Type_Declaration (Loc, + Defining_Identifier => Typ, + Type_Definition => + Make_Access_To_Object_Definition (Loc, + Subtype_Indication => New_Occurrence_Of (Etype (E), Loc))); end Build_Access_Type_Decl; --------------- @@ -247,6 +235,17 @@ package body Exp_Unst is return False; end In_Synchronized_Unit; + ----------------------- + -- Needs_Fat_Pointer -- + ----------------------- + + function Needs_Fat_Pointer (E : Entity_Id) return Boolean is + begin + return Is_Formal (E) + and then Is_Array_Type (Etype (E)) + and then not Is_Constrained (Etype (E)); + end Needs_Fat_Pointer; + ---------------- -- Subp_Index -- ---------------- @@ -815,7 +814,7 @@ package body Exp_Unst is -- handled as an entity reference. if Nkind (N) = N_Allocator - and then Nkind (Expression (N)) = N_Qualified_Expression + and then Nkind (Expression (N)) = N_Qualified_Expression then declare DT : Boolean := False; @@ -1559,22 +1558,23 @@ package body Exp_Unst is -- Local declarations for one such subprogram declare - Loc : constant Source_Ptr := Sloc (STJ.Bod); + Loc : constant Source_Ptr := Sloc (STJ.Bod); + + Decls : constant List_Id := New_List; + -- List of new declarations we create + Clist : List_Id; Comp : Entity_Id; + Decl_Assign : Node_Id; + -- Assigment to set uplink, Empty if none + Decl_ARECnT : Node_Id; Decl_ARECnPT : Node_Id; Decl_ARECn : Node_Id; Decl_ARECnP : Node_Id; -- Declaration nodes for the AREC entities we build - Decl_Assign : Node_Id; - -- Assigment to set uplink, Empty if none - - Decls : constant List_Id := New_List; - -- List of new declarations we create - begin -- Build list of component declarations for ARECnT @@ -1647,7 +1647,7 @@ package body Exp_Unst is Subtype_Indication => New_Occurrence_Of (Defining_Identifier (Ptr_Decl), - Loc)))); + Loc)))); else Append_To (Clist, Make_Component_Declaration (Loc, @@ -1711,7 +1711,7 @@ package body Exp_Unst is New_Occurrence_Of (STJ.ARECnPT, Loc), Expression => Make_Attribute_Reference (Loc, - Prefix => + Prefix => New_Occurrence_Of (STJ.ARECn, Loc), Attribute_Name => Name_Access)); Append_To (Decls, Decl_ARECnP); @@ -1786,16 +1786,17 @@ package body Exp_Unst is Loc : constant Source_Ptr := Sloc (Ent); Dec : constant Node_Id := Declaration_Node (Ent); - Ins : Node_Id; + Asn : Node_Id; Attr : Name_Id; + Ins : Node_Id; begin -- For parameters, we insert the assignment -- right after the declaration of ARECnP. -- For all other entities, we insert - -- the assignment immediately after - -- the declaration of the entity. + -- the assignment immediately after the + -- declaration of the entity. -- Note: we don't need to mark the entity -- as being aliased, because the address @@ -2224,9 +2225,9 @@ package body Exp_Unst is end; end if; - -- The proper body of a stub may contain nested subprograms, - -- and therefore must be visited explicitly. Nested stubs are - -- examined recursively in Visit_Node. + -- The proper body of a stub may contain nested subprograms, and + -- therefore must be visited explicitly. Nested stubs are examined + -- recursively in Visit_Node. if Nkind (N) in N_Body_Stub then Do_Search (Library_Unit (N)); diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index f615e650454..23de7a73651 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -900,8 +900,8 @@ package body Inline is function Uses_Secondary_Stack (Bod : Node_Id) return Boolean; -- If the body of the subprogram includes a call that returns an - -- unconstrained type, the secondary stack is involved, and it - -- is not worth inlining. + -- unconstrained type, the secondary stack is involved, and it is + -- not worth inlining. ------------------------- -- Has_Extended_Return -- diff --git a/gcc/ada/libgnat/a-ciorma.adb b/gcc/ada/libgnat/a-ciorma.adb index 000851a8cac..d8247608147 100644 --- a/gcc/ada/libgnat/a-ciorma.adb +++ b/gcc/ada/libgnat/a-ciorma.adb @@ -541,9 +541,10 @@ package body Ada.Containers.Indefinite_Ordered_Maps is "Position cursor of function Element is bad"; end if; - if Checks and then - (Left (Position.Node) = Position.Node - or else Right (Position.Node) = Position.Node) + if Checks + and then (Left (Position.Node) = Position.Node + or else + Right (Position.Node) = Position.Node) then raise Program_Error with "dangling cursor"; end if; diff --git a/gcc/ada/libgnat/a-ciormu.adb b/gcc/ada/libgnat/a-ciormu.adb index 5c3e9f75bb2..0483f0a1f53 100644 --- a/gcc/ada/libgnat/a-ciormu.adb +++ b/gcc/ada/libgnat/a-ciormu.adb @@ -545,9 +545,10 @@ package body Ada.Containers.Indefinite_Ordered_Multisets is raise Program_Error with "Position cursor is bad"; end if; - if Checks and then - (Left (Position.Node) = Position.Node - or else Right (Position.Node) = Position.Node) + if Checks + and then (Left (Position.Node) = Position.Node + or else + Right (Position.Node) = Position.Node) then raise Program_Error with "dangling cursor"; end if; diff --git a/gcc/ada/libgnat/a-ciorse.adb b/gcc/ada/libgnat/a-ciorse.adb index 7394a4aedc5..7b541e3d972 100644 --- a/gcc/ada/libgnat/a-ciorse.adb +++ b/gcc/ada/libgnat/a-ciorse.adb @@ -534,9 +534,10 @@ package body Ada.Containers.Indefinite_Ordered_Sets is raise Program_Error with "Position cursor is bad"; end if; - if Checks and then - (Left (Position.Node) = Position.Node - or else Right (Position.Node) = Position.Node) + if Checks + and then (Left (Position.Node) = Position.Node + or else + Right (Position.Node) = Position.Node) then raise Program_Error with "dangling cursor"; end if; diff --git a/gcc/ada/libgnat/a-coorma.adb b/gcc/ada/libgnat/a-coorma.adb index 5fd3ec68a50..7ec507729cf 100644 --- a/gcc/ada/libgnat/a-coorma.adb +++ b/gcc/ada/libgnat/a-coorma.adb @@ -481,9 +481,10 @@ package body Ada.Containers.Ordered_Maps is "Position cursor of function Element equals No_Element"; end if; - if Checks and then - (Left (Position.Node) = Position.Node - or else Right (Position.Node) = Position.Node) + if Checks + and then (Left (Position.Node) = Position.Node + or else + Right (Position.Node) = Position.Node) then raise Program_Error with "dangling cursor"; end if; diff --git a/gcc/ada/libgnat/a-coormu.adb b/gcc/ada/libgnat/a-coormu.adb index c114cf9f48a..c5548bfd1be 100644 --- a/gcc/ada/libgnat/a-coormu.adb +++ b/gcc/ada/libgnat/a-coormu.adb @@ -502,9 +502,10 @@ package body Ada.Containers.Ordered_Multisets is raise Constraint_Error with "Position cursor equals No_Element"; end if; - if Checks and then - (Left (Position.Node) = Position.Node - or else Right (Position.Node) = Position.Node) + if Checks + and then (Left (Position.Node) = Position.Node + or else + Right (Position.Node) = Position.Node) then raise Program_Error with "dangling cursor"; end if; diff --git a/gcc/ada/libgnat/a-coorse.adb b/gcc/ada/libgnat/a-coorse.adb index 1f96d39499a..2033effbce4 100644 --- a/gcc/ada/libgnat/a-coorse.adb +++ b/gcc/ada/libgnat/a-coorse.adb @@ -480,9 +480,10 @@ package body Ada.Containers.Ordered_Sets is raise Constraint_Error with "Position cursor equals No_Element"; end if; - if Checks and then - (Left (Position.Node) = Position.Node - or else Right (Position.Node) = Position.Node) + if Checks + and then (Left (Position.Node) = Position.Node + or else + Right (Position.Node) = Position.Node) then raise Program_Error with "dangling cursor"; end if; diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index c5b710e840d..a88b37de65d 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -2499,12 +2499,12 @@ package body Sem_Prag is end if; if (Is_Subprogram (Context) - or else Ekind (Context) = E_Task_Type - or else Is_Single_Task_Object (Context)) + or else Ekind (Context) = E_Task_Type + or else Is_Single_Task_Object (Context)) and then - (Present (Get_Pragma (Context, Pragma_Global)) - or else - Present (Get_Pragma (Context, Pragma_Refined_Global))) + (Present (Get_Pragma (Context, Pragma_Global)) + or else + Present (Get_Pragma (Context, Pragma_Refined_Global))) then Collect_Subprogram_Inputs_Outputs (Subp_Id => Context, -- 2.30.2