]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Minor reformatting
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Nov 2018 11:41:25 +0000 (11:41 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Nov 2018 11:41:25 +0000 (11:41 +0000)
2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* back_end.adb, checks.adb, exp_ch3.adb, exp_ch4.adb,
exp_ch7.adb, exp_disp.adb, exp_unst.adb, exp_util.adb,
freeze.adb, sem_ch13.adb, sem_ch6.adb, sem_ch7.adb,
sem_prag.adb, sem_spark.adb, sem_util.adb: Minor reformatting.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266122 138bc75d-0d04-0410-961f-82ee72b054a4

16 files changed:
gcc/ada/ChangeLog
gcc/ada/back_end.adb
gcc/ada/checks.adb
gcc/ada/exp_ch3.adb
gcc/ada/exp_ch4.adb
gcc/ada/exp_ch7.adb
gcc/ada/exp_disp.adb
gcc/ada/exp_unst.adb
gcc/ada/exp_util.adb
gcc/ada/freeze.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch6.adb
gcc/ada/sem_ch7.adb
gcc/ada/sem_prag.adb
gcc/ada/sem_spark.adb
gcc/ada/sem_util.adb

index 2ebc0c9ecfdd2642d6cf9a37447021dc35059ab0..c407793a0a665b4d026a8376386a52abc6a2462b 100644 (file)
@@ -1,3 +1,10 @@
+2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * back_end.adb, checks.adb, exp_ch3.adb, exp_ch4.adb,
+       exp_ch7.adb, exp_disp.adb, exp_unst.adb, exp_util.adb,
+       freeze.adb, sem_ch13.adb, sem_ch6.adb, sem_ch7.adb,
+       sem_prag.adb, sem_spark.adb, sem_util.adb: Minor reformatting.
+
 2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * exp_ch4.adb (Find_Aliased_Equality): New routine.
index 61ab71879bb71858074e76d88f4fb2eed816800d..e7798c845da833c1c3198ee7d135833fcf8d120f 100644 (file)
@@ -237,22 +237,21 @@ package body Back_End is
          Last  : constant Natural  := Switch_Last (Switch_Chars);
 
       begin
-         --  Skip -o or internal GCC switches together with their argument.
+         --  Skip -o or internal GCC switches together with their argument
 
          if Switch_Chars (First .. Last) = "o"
            or else Is_Internal_GCC_Switch (Switch_Chars)
          then
             Next_Arg := Next_Arg + 1;
 
-         --  Store -G xxx as -Gxxx and go directly to the next argument.
+         --  Store -G xxx as -Gxxx and go directly to the next argument
 
          elsif Switch_Chars (First .. Last) = "G" then
             Next_Arg := Next_Arg + 1;
 
             --  Should never get there with -G not followed by an argument,
-            --  but use defensive code nonetheless.
-            --  Store as -Gxxx to avoid storing parameters in ALI files that
-            --  might create confusion.
+            --  but use defensive code nonetheless. Store as -Gxxx to avoid
+            --  storing parameters in ALI files that might create confusion.
 
             if Next_Arg <= Args'Last then
                Store_Compilation_Switch (Switch_Chars & Args (Next_Arg).all);
index e7048ecc4ef188eed63925b1c65f72fbd0827ec0..6b9e6541f86f47d4b50365ff5ba8e72504a93d04 100644 (file)
@@ -3552,8 +3552,8 @@ package body Checks is
                else
                   --  Conversions involving fixed-point types are expanded
                   --  separately, and do not need a Range_Check flag, except
-                  --  in SPARK_Mode, where the explicit constraint check will
-                  --  not be generated.
+                  --  in GNATprove_Mode, where the explicit constraint check
+                  --  will not be generated.
 
                   if GNATprove_Mode
                     or else not Is_Fixed_Point_Type (Expr_Type)
index e116cda4442870205b60bd7854085206407855d1..1eddd61b992c566850d37fbc0633d28911b7b40d 100644 (file)
@@ -8611,17 +8611,17 @@ package body Exp_Ch3 is
    ------------------
 
    function Init_Formals (Typ : Entity_Id) return List_Id is
-      Unc_Arr : constant Boolean :=
-        Is_Array_Type (Typ) and then not Is_Constrained (Typ);
+      Loc        : constant Source_Ptr := Sloc (Typ);
+      Unc_Arr    : constant Boolean :=
+                     Is_Array_Type (Typ) and then not Is_Constrained (Typ);
       With_Prot  : constant Boolean :=
-        Has_Protected (Typ)
-          or else (Is_Record_Type (Typ)
-                     and then Is_Protected_Record_Type (Typ));
+                     Has_Protected (Typ)
+                       or else (Is_Record_Type (Typ)
+                                 and then Is_Protected_Record_Type (Typ));
       With_Task  : constant Boolean :=
-        Has_Task (Typ)
-          or else (Is_Record_Type (Typ)
-                     and then Is_Task_Record_Type (Typ));
-      Loc     : constant Source_Ptr := Sloc (Typ);
+                     Has_Task (Typ)
+                       or else (Is_Record_Type (Typ)
+                                 and then Is_Task_Record_Type (Typ));
       Formals : List_Id;
 
    begin
@@ -9038,8 +9038,8 @@ package body Exp_Ch3 is
       Stmt : Node_Id;
 
    begin
-      --  We must skip SCIL nodes because they may have been added to the
-      --  list by Insert_Actions.
+      --  We must skip SCIL nodes because they may have been added to the list
+      --  by Insert_Actions.
 
       Stmt := First_Non_SCIL_Node (Stmts);
       while Present (Stmt) loop
index c427b9e1e034daff544dc2ad36d60ee8ab24dd05..a00e0c7761d1fa1621a8801f335177443551db99 100644 (file)
@@ -4085,9 +4085,9 @@ package body Exp_Ch4 is
               Unchecked_Convert_To (Standard_Integer, Op_Expr));
 
          else
-            --  If the modulus of the type is larger than Integer'Last
-            --  use a larger type for the operands, to prevent spurious
-            --  constraint errors on large legal literals of the type.
+            --  If the modulus of the type is larger than Integer'Last use a
+            --  larger type for the operands, to prevent spurious constraint
+            --  errors on large legal literals of the type.
 
             if Modulus (Etype (N)) > UI_From_Int (Int (Integer'Last)) then
                Target_Type := Standard_Long_Integer;
@@ -11764,8 +11764,8 @@ package body Exp_Ch4 is
             elsif Is_Integer_Type (Etype (N)) then
                Expand_Convert_Fixed_To_Integer (N);
 
-               --  The result of the conversion might need a range check,
-               --   so do not assume that the result is in bounds.
+               --  The result of the conversion might need a range check, so do
+               --  not assume that the result is in bounds.
 
                Set_Etype (N, Base_Type (Target_Type));
 
index c579e627cb358c01fb04747611fe40ebe574e386..c8f39e7b4eea8015ef4623ac06d8dbeb5a427b3f 100644 (file)
@@ -362,10 +362,10 @@ package body Exp_Ch7 is
 
    procedure Check_Unnesting_In_Declarations (N : Node_Id);
    --  Similarly, the declarations in the package body may have created
-   --  blocks with nested subprograms. Such a block must be transformed
-   --  into a procedure followed by a call to it, so that unnesting can
-   --  handle uplevel references within these nested subprograms (typically
-   --  generated subprograms to handle finalization actions).
+   --  blocks with nested subprograms. Such a block must be transformed into a
+   --  procedure followed by a call to it, so that unnesting can handle uplevel
+   --  references within these nested subprograms (typically generated
+   --  subprograms to handle finalization actions).
 
    procedure Check_Visibly_Controlled
      (Prim : Final_Primitives;
@@ -4177,16 +4177,16 @@ package body Exp_Ch7 is
 
    procedure Check_Unnesting_In_Declarations (N : Node_Id) is
       Decl       : Node_Id;
+      Ent        : Entity_Id;
       Inner_Decl : Node_Id;
       Loc        : Source_Ptr;
       Local_Body : Node_Id;
       Local_Call : Node_Id;
-
-      Ent        : Entity_Id;
       Local_Proc : Entity_Id;
 
    begin
       Local_Call := Empty;
+
       if Unnest_Subprogram_Mode
         and then Present (Declarations (N))
         and then Is_Compilation_Unit (Current_Scope)
@@ -4198,7 +4198,6 @@ package body Exp_Ch7 is
                Inner_Decl := First (Declarations (Decl));
 
                while Present (Inner_Decl) loop
-
                   if Nkind (Inner_Decl) = N_Subprogram_Body then
                      Loc := Sloc (Decl);
                      Local_Proc :=
@@ -4213,6 +4212,7 @@ package body Exp_Ch7 is
                              Declarations       => Declarations (Decl),
                          Handled_Statement_Sequence =>
                            Handled_Statement_Sequence (Decl));
+
                      Rewrite (Decl, Local_Body);
                      Analyze (Decl);
                      Set_Has_Nested_Subprogram (Local_Proc);
@@ -4220,6 +4220,7 @@ package body Exp_Ch7 is
                      Local_Call :=
                        Make_Procedure_Call_Statement (Loc,
                          Name => New_Occurrence_Of (Local_Proc, Loc));
+
                      Insert_After (Decl, Local_Call);
                      Analyze (Local_Call);
 
index 79c08978071b446db09099f693eb13b2dee8e2ea..f36cd1f8aed9c70fa8cf64284045dc617f897d80 100644 (file)
@@ -1367,9 +1367,7 @@ package body Exp_Disp is
          --  to the object, because generic dispatching constructors are not
          --  supported.
 
-         if Opnd = Iface_Typ
-           and then not RTE_Available (RE_Displace)
-         then
+         if Opnd = Iface_Typ and then not RTE_Available (RE_Displace) then
             return;
          end if;
       end;
@@ -2487,10 +2485,10 @@ package body Exp_Disp is
      (Typ : Entity_Id) return Node_Id
    is
       Loc    : constant Source_Ptr := Sloc (Typ);
-      Def_Id : constant Entity_Id :=
+      B_Id   : constant Entity_Id  := Make_Defining_Identifier (Loc, Name_uB);
+      Def_Id : constant Entity_Id  :=
                  Make_Defining_Identifier (Loc,
                    Name_uDisp_Asynchronous_Select);
-      B_Id   : constant Entity_Id  := Make_Defining_Identifier (Loc, Name_uB);
       Params : constant List_Id    := New_List;
 
    begin
@@ -2503,6 +2501,7 @@ package body Exp_Disp is
       --  F : out Boolean;                    --  Status flag
 
       --  The B parameter may be left uninitialized
+
       Set_Warnings_Off (B_Id);
 
       Append_List_To (Params, New_List (
index abcc6603c51da082d7122a6863a28e9fbd858df7..882866e38e0cb856344a568231c0243409b824e5 100644 (file)
@@ -752,14 +752,10 @@ package body Exp_Unst is
             procedure Register_Subprogram (E : Entity_Id; Bod : Node_Id) is
                L : constant Nat := Get_Level (Subp, E);
 
-            --  Subprograms declared in tasks and protected types cannot
-            --  be eliminated because calls to them may be in other units,
-            --  so they must be treated as reachable.
-
             begin
-               --  Subprograms declared in tasks and protected types cannot
-               --  be eliminated because calls to them may be in other units,
-               --  so they must be treated as reachable.
+               --  Subprograms declared in tasks and protected types cannot be
+               --  eliminated because calls to them may be in other units, so
+               --  they must be treated as reachable.
 
                Subps.Append
                  ((Ent           => E,
@@ -1154,9 +1150,9 @@ package body Exp_Unst is
                      return Skip;
                   end if;
 
-               --  Pragmas and component declarations can be ignored.
-               --  Quantified expressions are expanded into explicit loops
-               --  and the original epression must be ignored.
+               --  Pragmas and component declarations are ignored. Quantified
+               --  expressions are expanded into explicit loops and the
+               --  original epression must be ignored.
 
                when N_Component_Declaration
                   | N_Pragma
@@ -1389,10 +1385,10 @@ package body Exp_Unst is
 
                         --  If this entity was marked reachable because it is
                         --  in a task or protected type, there may not appear
-                        --  to be any calls to it, which would normally
-                        --  adjust the levels of the parent subprograms.
-                        --  So we need to be sure that the uplevel reference
-                        --  of that entity takes into account possible calls.
+                        --  to be any calls to it, which would normally adjust
+                        --  the levels of the parent subprograms. So we need to
+                        --  be sure that the uplevel reference of that entity
+                        --  takes into account possible calls.
 
                         if In_Synchronized_Unit (SUBF.Ent)
                           and then SUBT.Lev < SUBI.Uplevel_Ref
@@ -1408,9 +1404,9 @@ package body Exp_Unst is
                   --  We do not add types to this list, only actual references
                   --  to objects that will be referenced uplevel, and we use
                   --  the flag Is_Uplevel_Referenced_Entity to avoid making
-                  --  duplicate entries in the list.
-                  --  Discriminants are also excluded, only the enclosing
-                  --  object can appear in the list.
+                  --  duplicate entries in the list. Discriminants are also
+                  --  excluded, only the enclosing object can appear in the
+                  --  list.
 
                   if not Is_Uplevel_Referenced_Entity (URJ.Ent)
                     and then Ekind (URJ.Ent) /= E_Discriminant
@@ -1750,8 +1746,8 @@ package body Exp_Unst is
                      --  Declaration nodes for the AREC entities we build
 
                   begin
-                     --  Build list of component declarations for ARECnT
-                     --  and load System.Address.
+                     --  Build list of component declarations for ARECnT and
+                     --  load System.Address.
 
                      Clist := Empty_List;
 
@@ -2009,10 +2005,11 @@ package body Exp_Unst is
                                     Attr := Name_Address;
                                  end if;
 
-                                 Rhs :=  Make_Attribute_Reference (Loc,
-                                         Prefix         =>
-                                           New_Occurrence_Of (Ent, Loc),
-                                         Attribute_Name => Attr);
+                                 Rhs :=
+                                  Make_Attribute_Reference (Loc,
+                                    Prefix         =>
+                                      New_Occurrence_Of (Ent, Loc),
+                                    Attribute_Name => Attr);
 
                                  --  If the entity is an unconstrained formal
                                  --  we wrap the attribute reference in an
@@ -2024,15 +2021,15 @@ package body Exp_Unst is
                                  if Is_Formal (Ent)
                                    and then not Is_Constrained (Etype (Ent))
                                  then
-                                    --  Find target component and its type.
+                                    --  Find target component and its type
 
                                     Comp := First_Component (STJ.ARECnT);
                                     while Chars (Comp) /= Chars (Ent) loop
                                        Comp := Next_Component (Comp);
                                     end loop;
 
-                                    Rhs := Unchecked_Convert_To (
-                                              Etype (Comp), Rhs);
+                                    Rhs :=
+                                      Unchecked_Convert_To (Etype (Comp), Rhs);
                                  end if;
 
                                  Asn :=
index 1ef342d318f7b04e14f407274aa675058b14900b..a76e92e7e444465135cd8339c243fa357e7c6655 100644 (file)
@@ -9313,9 +9313,9 @@ package body Exp_Util is
 
       --  If the type is tagged, the expression may be class-wide, in which
       --  case it has to be converted to its root type, given that the
-      --  generated predicate function is not dispatching. The conversion
-      --  is type-safe and does not need validation, which matters when
-      --  private extensions are involved.
+      --  generated predicate function is not dispatching. The conversion is
+      --  type-safe and does not need validation, which matters when private
+      --  extensions are involved.
 
       if Is_Tagged_Type (Typ) then
          Call :=
index 19b9ca9ecff44f3cc2a0b03ed0072fb76a8a57b2..6734f6df5442830ee7d1e21867a4bf68b2a186b5 100644 (file)
@@ -8008,12 +8008,12 @@ package body Freeze is
                Set_Realval (Lo, Loval);
             end if;
 
-            --  Compute the fudged bounds. If the bound is a model number,
-            --  (or greater if given low bound, smaller if high bound)
-            --  then we do nothing to include it, but we are allowed to backoff
-            --  to the next adjacent model number when we exclude it. If it is
-            --  not a model number then we straddle the two values with the
-            --  model numbers on either side.
+            --  Compute the fudged bounds. If the bound is a model number, (or
+            --  greater if given low bound, smaller if high bound) then we do
+            --  nothing to include it, but we are allowed to backoff to the
+            --  next adjacent model number when we exclude it. If it is not a
+            --  model number then we straddle the two values with the model
+            --  numbers on either side.
 
             Model_Num := UR_Trunc (Loval / Small) * Small;
 
index b999be630347944c6b69978bfc77ecf1df9d1de9..92d65e64ede562e2b2a8b195478e6baa7190981c 100644 (file)
@@ -11449,6 +11449,20 @@ package body Sem_Ch13 is
       function Rep_Item_Entity (Rep_Item : Node_Id) return Entity_Id;
       --  Return the entity for which Rep_Item is specified
 
+      --------------------------------------------------
+      -- Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item --
+      --------------------------------------------------
+
+      function Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item
+        (Rep_Item : Node_Id) return Boolean
+      is
+      begin
+         return
+           Nkind (Rep_Item) = N_Pragma
+             or else Present_In_Rep_Item
+                       (Entity (Rep_Item), Aspect_Rep_Item (Rep_Item));
+      end Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item;
+
       ---------------------
       -- Rep_Item_Entity --
       ---------------------
@@ -11460,26 +11474,12 @@ package body Sem_Ch13 is
 
          else
             pragma Assert (Nkind_In (Rep_Item,
-                                     N_Pragma,
-                                     N_Attribute_Definition_Clause));
+                                     N_Attribute_Definition_Clause,
+                                     N_Pragma));
             return Entity (Name (Rep_Item));
          end if;
       end Rep_Item_Entity;
 
-      --------------------------------------------------
-      -- Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item --
-      --------------------------------------------------
-
-      function Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item
-        (Rep_Item : Node_Id) return Boolean
-      is
-      begin
-         return
-           Nkind (Rep_Item) = N_Pragma
-             or else Present_In_Rep_Item
-                       (Entity (Rep_Item), Aspect_Rep_Item (Rep_Item));
-      end Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item;
-
    --  Start of processing for Inherit_Aspects_At_Freeze_Point
 
    begin
index 166987ad016481c600811494401ae695792e249f..f7b688045eae1416d6b137b3a90044ee48814142 100644 (file)
@@ -8925,9 +8925,9 @@ package body Sem_Ch6 is
                  and then Discriminal_Link (Entity (E1)) =
                           Discriminal_Link (Entity (E2)))
 
-             --  AI12-050: The loop variables of quantified expressions
-             --  match if they have the same identifier, even though they
-             --  are different entities.
+             --  AI12-050: The loop variables of quantified expressions match
+             --  if they have the same identifier, even though they may have
+             --  different entities.
 
               or else
                 (Chars (Entity (E1)) = Chars (Entity (E2))
@@ -8935,8 +8935,8 @@ package body Sem_Ch6 is
                   and then Ekind (Entity (E2)) = E_Loop_Parameter)
 
               --  A call to an instantiation of Unchecked_Conversion is
-              --  rewritten with the name of the generated function
-              --  created for the instance, and this must be special-cased.
+              --  rewritten with the name of the generated function created for
+              --  the instance, and this must be special-cased.
 
               or else
                  (Ekind (Entity (E1)) = E_Function
index 1c732b4281bb489b2f1e194fea98fd6d34d11c91..28119dfd121f2f74dc547ebb2ed8b98ee9acdcb2 100644 (file)
@@ -2855,13 +2855,13 @@ package body Sem_Ch7 is
                   Set_Is_Potentially_Use_Visible (Id);
                end if;
 
-            --  We need to avoid incorrectly marking enumeration literals
-            --  as non-visible when a visible use-all-type clause is in effect.
+            --  We need to avoid incorrectly marking enumeration literals as
+            --  non-visible when a visible use-all-type clause is in effect.
 
             elsif Type_In_Use (Etype (Id))
-                    and then Nkind (Current_Use_Clause (Etype (Id))) =
-                               N_Use_Type_Clause
-                    and then All_Present (Current_Use_Clause (Etype (Id)))
+              and then Nkind (Current_Use_Clause (Etype (Id))) =
+                         N_Use_Type_Clause
+              and then All_Present (Current_Use_Clause (Etype (Id)))
             then
                null;
 
index 2293f73cbd50f5762012e61f03728e3fd8c83767..a96d148ecbbc08f188b6f9c9ce9ff6c31d16ed2b 100644 (file)
@@ -27743,8 +27743,9 @@ package body Sem_Prag is
                else
                   pragma Assert (Present (Global));
                   Error_Msg_Sloc := Sloc (Global);
-                  SPARK_Msg_NE ("extra global item & does not refine or " &
-                                "repeat any global item #", Item, Item_Id);
+                  SPARK_Msg_NE
+                    ("extra global item & does not refine or repeat any "
+                     & "global item #", Item, Item_Id);
                end if;
             end if;
          end Check_Refined_Global_Item;
index 0fe7c1b881cd30ed7b90e68dd505f3c96f19dd48..b8baeeb209f0499463617aebb48162148f20628b 100644 (file)
@@ -863,7 +863,6 @@ package body Sem_SPARK is
    -----------------------
 
    procedure Check_Declaration (Decl : Node_Id) is
-
       Target_Ent : constant Entity_Id := Defining_Identifier (Decl);
       Target_Typ : Node_Id renames Etype (Target_Ent);
 
index 58669dd39377dfa756143296a71b3d24ca966eff..e3d7718a5996e9590f89aeac96e75aff883fd89a 100644 (file)
@@ -8593,9 +8593,7 @@ package body Sem_Util is
 
          --  Single global item declaration (only input items)
 
-         elsif Nkind_In (List, N_Expanded_Name,
-                               N_Identifier)
-         then
+         elsif Nkind_In (List, N_Expanded_Name, N_Identifier) then
             if Global_Mode = Name_Input then
                return List;
             else
@@ -8647,9 +8645,9 @@ package body Sem_Util is
       Body_Id : Entity_Id;
 
    begin
-      pragma Assert (Nam_In (Global_Mode, Name_Input,
+      pragma Assert (Nam_In (Global_Mode, Name_In_Out,
+                                          Name_Input,
                                           Name_Output,
-                                          Name_In_Out,
                                           Name_Proof_In));
 
       --  Retrieve the suitable pragma Global or Refined_Global. In the second