diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/einfo.adb | 2 | ||||
-rw-r--r-- | gcc/ada/einfo.ads | 2 | ||||
-rw-r--r-- | gcc/ada/exp_ch3.adb | 55 | ||||
-rw-r--r-- | gcc/ada/exp_ch8.adb | 12 | ||||
-rw-r--r-- | gcc/ada/exp_unst.adb | 22 | ||||
-rw-r--r-- | gcc/ada/pprint.adb | 15 | ||||
-rw-r--r-- | gcc/ada/sem_ch12.adb | 8 | ||||
-rw-r--r-- | gcc/ada/sem_ch3.adb | 5 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 17 | ||||
-rw-r--r-- | gcc/ada/sem_util.adb | 2 |
11 files changed, 82 insertions, 64 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5cd546a..a24c898 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-05-25 Hristian Kirtchev <kirtchev@adacore.com> + + * einfo.adb, einfo.ads, exp_ch3.adb, exp_ch8.adb, exp_unst.adb, + pprint.adb, sem_ch12.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb: + Minor reformatting. + 2018-05-25 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Instance_Exists): New function, subsidiary of diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 77e1eb3..cdfd44d 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -275,8 +275,6 @@ package body Einfo is -- Entry_Max_Queue_Lengths_Array Node35 -- Import_Pragma Node35 - -- Prev_Entity Node36 - -- Validated_Object Node38 -- Predicated_Parent Node38 -- Class_Wide_Clone Node38 diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index cd28754..17d6937 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -2303,7 +2303,7 @@ package Einfo is -- Applies to all entities, true for access types and subtypes -- Is_Activation_Record (Flag305) --- Applies to In_Parameters generated in Exp_Unst for nested +-- Applies to E_In_Parameters generated in Exp_Unst for nested -- subprograms, to mark the added formal that carries the activation -- record created in the enclosing subprogram. diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 6c3f7dc..d1ed971 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -4274,15 +4274,15 @@ package body Exp_Ch3 is Body_Id : Entity_Id; Param_Specs : List_Id) return Node_Id is - Loc : constant Source_Ptr := Sloc (Typ); - Def : constant Node_Id := Parent (Typ); - Comps : constant Node_Id := Component_List (Type_Definition (Def)); - Left : constant Entity_Id := Defining_Identifier - (First (Param_Specs)); - Right : constant Entity_Id := Defining_Identifier - (Next (First (Param_Specs))); - Decls : constant List_Id := New_List; - Stmts : constant List_Id := New_List; + Loc : constant Source_Ptr := Sloc (Typ); + Def : constant Node_Id := Parent (Typ); + Comps : constant Node_Id := Component_List (Type_Definition (Def)); + Left : constant Entity_Id := Defining_Identifier (First (Param_Specs)); + Right : constant Entity_Id := + Defining_Identifier (Next (First (Param_Specs))); + Decls : constant List_Id := New_List; + Stmts : constant List_Id := New_List; + Subp_Body : Node_Id; begin @@ -4317,9 +4317,10 @@ package body Exp_Ch3 is if Is_Unchecked_Union (Typ) then declare + A : Entity_Id; + B : Entity_Id; Discr : Entity_Id; Discr_Type : Entity_Id; - A, B : Entity_Id; New_Discrs : Elist_Id; begin @@ -4328,11 +4329,14 @@ package body Exp_Ch3 is Discr := First_Discriminant (Typ); while Present (Discr) loop Discr_Type := Etype (Discr); - A := Make_Defining_Identifier (Loc, - Chars => New_External_Name (Chars (Discr), 'A')); - B := Make_Defining_Identifier (Loc, - Chars => New_External_Name (Chars (Discr), 'B')); + A := + Make_Defining_Identifier (Loc, + Chars => New_External_Name (Chars (Discr), 'A')); + + B := + Make_Defining_Identifier (Loc, + Chars => New_External_Name (Chars (Discr), 'B')); -- Add new parameters to the parameter list @@ -4371,9 +4375,9 @@ package body Exp_Ch3 is end loop; -- Generate component-by-component comparison. Note that we must - -- propagate the inferred discriminants formals to act as - -- the case statement switch. Their value is added when an - -- equality call on unchecked unions is expanded. + -- propagate the inferred discriminants formals to act as the case + -- statement switch. Their value is added when an equality call on + -- unchecked unions is expanded. Append_List_To (Stmts, Make_Eq_Case (Typ, Comps, New_Discrs)); end; @@ -4392,7 +4396,7 @@ package body Exp_Ch3 is Subp_Body := Make_Subprogram_Body (Loc, - Specification => + Specification => Make_Function_Specification (Loc, Defining_Unit_Name => Body_Id, Parameter_Specifications => Param_Specs, @@ -4952,9 +4956,13 @@ package body Exp_Ch3 is -- Create An Equality function for the untagged variant record Typ and -- attach it to the TSS list. + ----------------------------------- + -- Build_Variant_Record_Equality -- + ----------------------------------- + procedure Build_Variant_Record_Equality (Typ : Entity_Id) is Loc : constant Source_Ptr := Sloc (Typ); - F : constant Entity_Id := + F : constant Entity_Id := Make_Defining_Identifier (Loc, Chars => Make_TSS_Name (Typ, TSS_Composite_Equality)); begin @@ -4992,12 +5000,13 @@ package body Exp_Ch3 is Body_Id => F, Param_Specs => New_List ( Make_Parameter_Specification (Loc, - Defining_Identifier => Make_Defining_Identifier (Loc, - Name_X), + Defining_Identifier => + Make_Defining_Identifier (Loc, Name_X), Parameter_Type => New_Occurrence_Of (Typ, Loc)), + Make_Parameter_Specification (Loc, - Defining_Identifier => Make_Defining_Identifier (Loc, - Name_Y), + Defining_Identifier => + Make_Defining_Identifier (Loc, Name_Y), Parameter_Type => New_Occurrence_Of (Typ, Loc))))); Set_TSS (Typ, F); diff --git a/gcc/ada/exp_ch8.adb b/gcc/ada/exp_ch8.adb index e2ffb91..279ba86 100644 --- a/gcc/ada/exp_ch8.adb +++ b/gcc/ada/exp_ch8.adb @@ -294,12 +294,12 @@ package body Exp_Ch8 is Body_Id => Body_Id, Param_Specs => Copy_Parameter_List (Id)); - -- Build body for renamed equality, to capture its current - -- meaning. It may be redefined later, but the renaming is - -- elaborated where it occurs. This is technically known as - -- Squirreling semantics. Renaming is rewritten as a subprogram - -- declaration, and the generated body is inserted into the - -- freeze actions for the subprogram. + -- Build body for renamed equality, to capture its current meaning. + -- It may be redefined later, but the renaming is elaborated where + -- it occurs. This is technically known as Squirreling semantics. + -- Renaming is rewritten as a subprogram declaration, and the + -- generated body is inserted into the freeze actions for the + -- subprogram. else Decl := diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index ec4539a..0b2ed21 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -400,14 +400,13 @@ package body Exp_Unst is procedure Note_Uplevel_Bound (N : Node_Id) is begin - -- Entity name case - -- Make sure that that the entity is declared in a - -- subprogram. THis may not be the case for an type + -- Entity name case. Make sure that the entity is declared + -- in a subprogram. This may not be the case for for a type -- in a loop appearing in a precondition. if Is_Entity_Name (N) then if Present (Entity (N)) - and then Present (Enclosing_Subprogram (Entity (N))) + and then Present (Enclosing_Subprogram (Entity (N))) then Note_Uplevel_Ref (E => Entity (N), @@ -617,17 +616,18 @@ package body Exp_Unst is end if; end if; end if; + when Attribute_First | Attribute_Last | Attribute_Length => - -- Special-case attributes of array objects - -- whose bounds may be uplevel references. - -- More complex prefixes are handled during - -- full traversal. Note that if the nominal - -- subtype of the prefix is unconstrained, the - -- bound must be obtained from the object, not - -- from the (possibly) uplevel reference, + -- Special-case attributes of array objects whose + -- bounds may be uplevel references. More complex + -- prefixes are handled during full traversal. Note + -- that if the nominal subtype of the prefix is + -- unconstrained, the bound must be obtained from + -- the object, not from the (possibly) uplevel + -- reference. if Is_Entity_Name (Prefix (N)) and then Is_Constrained (Etype (Prefix (N))) diff --git a/gcc/ada/pprint.adb b/gcc/ada/pprint.adb index 53354ae..24c9aa1 100644 --- a/gcc/ada/pprint.adb +++ b/gcc/ada/pprint.adb @@ -765,8 +765,8 @@ package body Pprint is -- If argument does not already account for a closing -- parenthesis, count one here. - if not Nkind_In (Right, N_Quantified_Expression, - N_Aggregate) + if not Nkind_In (Right, N_Aggregate, + N_Quantified_Expression) then Append_Paren := Append_Paren + 1; end if; @@ -831,19 +831,21 @@ package body Pprint is end if; when N_Quantified_Expression => - Right := Original_Node (Condition (Right)); + Right := Original_Node (Condition (Right)); Append_Paren := Append_Paren + 1; when N_Aggregate => declare Aggr : constant Node_Id := Right; Sub : Node_Id; + begin Sub := First (Expressions (Aggr)); while Present (Sub) loop if Sloc (Sub) > Sloc (Right) then Right := Sub; end if; + Next (Sub); end loop; @@ -852,6 +854,7 @@ package body Pprint is if Sloc (Sub) > Sloc (Right) then Right := Sub; end if; + Next (Sub); end loop; @@ -948,8 +951,10 @@ package body Pprint is end; else - return Buffer (1 .. Index) & Expr_Name (Right, False) - & (1 .. Append_Paren => ')'); + return + Buffer (1 .. Index) + & Expr_Name (Right, False) + & (1 .. Append_Paren => ')'); end if; end; end; diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index f97f083..93a1c12 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -12371,9 +12371,9 @@ package body Sem_Ch12 is else declare + Act_Iface_List : Elist_Id; Iface : Node_Id; Iface_Ent : Entity_Id; - Act_Iface_List : Elist_Id; function Instance_Exists (I : Entity_Id) return Boolean; -- If the interface entity is declared in a generic unit, @@ -12413,8 +12413,8 @@ package body Sem_Ch12 is while Present (Iface) loop Iface_Ent := Get_Instance_Of (Entity (Iface)); - if Is_Ancestor (Iface_Ent, Act_T) - or else Is_Progenitor (Iface_Ent, Act_T) + if Is_Ancestor (Iface_Ent, Act_T) + or else Is_Progenitor (Iface_Ent, Act_T) then null; @@ -12427,7 +12427,7 @@ package body Sem_Ch12 is Error_Msg_Name_1 := Chars (Act_T); Error_Msg_NE ("Actual% must implement interface&", - Actual, Etype (Iface)); + Actual, Etype (Iface)); end if; Next (Iface); diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 00e81ce..8c5b26d 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -18804,8 +18804,9 @@ package body Sem_Ch3 is -- (for example see the expansion of Deep_Adjust). if Ekind (C) = E_Discriminant and then Present (N) then - return not Comes_From_Source (N) - or else not Is_Completely_Hidden (C); + return + not Comes_From_Source (N) + or else not Is_Completely_Hidden (C); else return True; end if; diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index eb6a018..ef475ff 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -28543,18 +28543,18 @@ package body Sem_Prag is | Name_Off => -- In CodePeer mode and GNATprove mode, we need to - -- consider all assertions, unless they are - -- disabled. Force Is_Checked on ignored assertions, in - -- particular because transformations of the AST may - -- depend on assertions being checked (e.g. the - -- translation of attribute 'Loop_Entry). + -- consider all assertions, unless they are disabled. + -- Force Is_Checked on ignored assertions, in particular + -- because transformations of the AST may depend on + -- assertions being checked (e.g. the translation of + -- attribute 'Loop_Entry). if CodePeer_Mode or GNATprove_Mode then Set_Is_Checked (N, True); Set_Is_Ignored (N, False); else - Set_Is_Ignored (N, True); Set_Is_Checked (N, False); + Set_Is_Ignored (N, True); end if; when Name_Check @@ -29787,9 +29787,8 @@ package body Sem_Prag is -- Follow subprogram renaming chain if Is_Subprogram (Def_Id) - and then - Nkind (Parent (Declaration_Node (Def_Id))) = - N_Subprogram_Renaming_Declaration + and then Nkind (Parent (Declaration_Node (Def_Id))) = + N_Subprogram_Renaming_Declaration and then Present (Alias (Def_Id)) then return Alias (Def_Id); diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 08ed9bf..81a056e 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -17878,8 +17878,8 @@ package body Sem_Util is ----------------------------- procedure Iterate_Call_Parameters (Call : Node_Id) is - Formal : Entity_Id := First_Formal (Get_Called_Entity (Call)); Actual : Node_Id := First_Actual (Call); + Formal : Entity_Id := First_Formal (Get_Called_Entity (Call)); begin while Present (Formal) loop |