]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Minor reformatting
authorHristian Kirtchev <kirtchev@adacore.com>
Fri, 25 May 2018 09:04:04 +0000 (09:04 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Fri, 25 May 2018 09:04:04 +0000 (09:04 +0000)
2018-05-25  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* 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.

From-SVN: r260727

gcc/ada/ChangeLog
gcc/ada/einfo.adb
gcc/ada/einfo.ads
gcc/ada/exp_ch3.adb
gcc/ada/exp_ch8.adb
gcc/ada/exp_unst.adb
gcc/ada/pprint.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_prag.adb
gcc/ada/sem_util.adb

index 5cd546a6d277df6acb5a059099b4459da3eb0eed..a24c898722cd391061c1de86c592af70c98debef 100644 (file)
@@ -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
index 77e1eb32ef9051e98318c7c245b1e2cc7c21222a..cdfd44d1ee1f514333a9362907fedc96bdcc9802 100644 (file)
@@ -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
index cd2875458427d5735031575df0fa493140073228..17d69372f64cf3a9dbe1de9bb127a902670449e9 100644 (file)
@@ -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.
 
index 6c3f7dc53ec3e9df750a4901b1f7822e1fadd459..d1ed971bd1e2092c3cbbd8f684dfd785923eae31 100644 (file)
@@ -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);
index e2ffb91775fcc43358fa081edef0ea12fd74dff7..279ba86ed04165a3beb5fb633b70aa67c026adcc 100644 (file)
@@ -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 :=
index ec4539a98412c2addd221441cddbb2636646a984..0b2ed21cd19e554c46f1216e2d851c60867adc42 100644 (file)
@@ -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)))
index 53354ae7ba2188f86f83f2d8654a386a3d222ba7..24c9aa1e447881b4e660d66e0496608f00501f9f 100644 (file)
@@ -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;
index f97f08375cc92d5a105aed74bae188fc715d5790..93a1c12053d721d858c8b3c4a27b7f1b355df75c 100644 (file)
@@ -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);
index 00e81ce48564079968056551349b1ada3a434c98..8c5b26d500140224259d7843febd30a232ce76e9 100644 (file)
@@ -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;
index eb6a018839b1f1c452350b2cd21968119104a152..ef475ffb155476e3ebe288e0b1127cd0293bb71a 100644 (file)
@@ -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);
index 08ed9bff6c89164999f16235a24c8d7ba4080724..81a056ecff63e5e16cdacba60b6b5aebccfb3c9f 100644 (file)
@@ -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