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

gcc/ada/

* exp_aggr.adb, exp_ch7.adb, gnat1drv.adb, sem_ch10.adb,
sem_ch13.adb, sem_ch6.adb, sem_ch7.adb, sem_util.adb: Minor
reformatting.

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

gcc/ada/ChangeLog
gcc/ada/exp_aggr.adb
gcc/ada/exp_ch7.adb
gcc/ada/gnat1drv.adb
gcc/ada/sem_ch10.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch6.adb
gcc/ada/sem_ch7.adb
gcc/ada/sem_util.adb

index 8c5d2a9b11e4624995ac94a779692563fb5726eb..3836046d47a3d40ad8372e74531cf220abf96b64 100644 (file)
@@ -1,3 +1,9 @@
+2018-12-11  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * exp_aggr.adb, exp_ch7.adb, gnat1drv.adb, sem_ch10.adb,
+       sem_ch13.adb, sem_ch6.adb, sem_ch7.adb, sem_util.adb: Minor
+       reformatting.
+
 2018-12-11  Eric Botcazou  <ebotcazou@adacore.com>
 
        * fe.h (Is_Atomic_Object): Declare.
index 64233a5d5c78fa3868bd76ac665a8a034b2e0864..1b644e1d74bfa32cd6860537cd0d9e7e93f2dabf 100644 (file)
@@ -7687,6 +7687,7 @@ package body Exp_Aggr is
    is
       In_Obj_Decl : Boolean := False;
       P           : Node_Id := Parent (N);
+
    begin
       while Present (P) loop
          if Nkind (P) = N_Object_Declaration then
@@ -8524,28 +8525,27 @@ package body Exp_Aggr is
    ----------------------------
 
    function Static_Array_Aggregate (N : Node_Id) return Boolean is
-
-      function Is_Static_Component (N : Node_Id) return Boolean;
-      --  Return True if N has a compile-time known value and can be passed as
-      --  is to the back-end without further expansion.
+      function Is_Static_Component (Nod : Node_Id) return Boolean;
+      --  Return True if Nod has a compile-time known value and can be passed
+      --  as is to the back-end without further expansion.
 
       ---------------------------
       --  Is_Static_Component  --
       ---------------------------
 
-      function Is_Static_Component (N : Node_Id) return Boolean is
+      function Is_Static_Component (Nod : Node_Id) return Boolean is
       begin
-         if Nkind_In (N, N_Integer_Literal, N_Real_Literal) then
+         if Nkind_In (Nod, N_Integer_Literal, N_Real_Literal) then
             return True;
 
-         elsif Is_Entity_Name (N)
-           and then Present (Entity (N))
-           and then Ekind (Entity (N)) = E_Enumeration_Literal
+         elsif Is_Entity_Name (Nod)
+           and then Present (Entity (Nod))
+           and then Ekind (Entity (Nod)) = E_Enumeration_Literal
          then
             return True;
 
-         elsif Nkind (N) = N_Aggregate
-           and then Compile_Time_Known_Aggregate (N)
+         elsif Nkind (Nod) = N_Aggregate
+           and then Compile_Time_Known_Aggregate (Nod)
          then
             return True;
 
@@ -8554,13 +8554,15 @@ package body Exp_Aggr is
          end if;
       end Is_Static_Component;
 
-      Bounds : constant Node_Id := Aggregate_Bounds (N);
+      --  Local variables
+
+      Bounds : constant Node_Id   := Aggregate_Bounds (N);
+      Typ    : constant Entity_Id := Etype (N);
 
-      Typ       : constant Entity_Id := Etype (N);
-      Agg       : Node_Id;
-      Expr      : Node_Id;
-      Lo        : Node_Id;
-      Hi        : Node_Id;
+      Agg  : Node_Id;
+      Expr : Node_Id;
+      Lo   : Node_Id;
+      Hi   : Node_Id;
 
    --  Start of processing for Static_Array_Aggregate
 
index a21b707fef440048020d0085e7870946b4b20950..4405a84381bfa1bf2cba8d475b3cac7b37fd7f3e 100644 (file)
@@ -4005,14 +4005,14 @@ package body Exp_Ch7 is
       --  may need an activation record.
 
       function First_Local_Scope (L : List_Id) return Entity_Id;
-      --  Find first entity in the elaboration code of the body that
-      --  contains or represents a subprogrsam body. A body can appear
-      --  within a block or a loop. or can appear by itself if generated
-      --  for an object declaration that involves controlled actions.
-      --  The first such entity encountered is used to reset the scopes
-      --  of all entities that become local to the hew elboration procedure.
-      --  This is needed for subsequent unnesting, which depends on the
-      --  scope links to determine the nesting level of each subprogram.
+      --  Find first entity in the elaboration code of the body that contains
+      --  or represents a subprogram body. A body can appear within a block or
+      --  a loop or can appear by itself if generated for an object declaration
+      --  that involves controlled actions. The first such entity encountered
+      --  is used to reset the scopes of all entities that become local to the
+      --  new elaboration procedure. This is needed for subsequent unnesting,
+      --  which depends on the scope links to determine the nesting level of
+      --  each subprogram.
 
       --------------------------
       --  Contains_Subprogram --
@@ -4023,7 +4023,6 @@ package body Exp_Ch7 is
 
       begin
          E := First_Entity (Blk);
-
          while Present (E) loop
             if Is_Subprogram (E) then
                return True;
@@ -4055,6 +4054,7 @@ package body Exp_Ch7 is
             case Nkind (Stat) is
                when N_Block_Statement =>
                   Id := Entity (Identifier (Stat));
+
                   if No (First_Ent) then
                      First_Ent := Id;
                   end if;
@@ -4065,6 +4065,7 @@ package body Exp_Ch7 is
 
                when N_Loop_Statement =>
                   Id := Entity (Identifier (Stat));
+
                   if No (First_Ent) then
                      First_Ent := Id;
                   end if;
@@ -4092,9 +4093,9 @@ package body Exp_Ch7 is
 
                   declare
                      Elif : Node_Id;
+
                   begin
                      Elif := First (Elsif_Parts (Stat));
-
                      while Present (Elif) loop
                         Scop := First_Local_Scope (Statements (Elif));
 
@@ -4109,9 +4110,9 @@ package body Exp_Ch7 is
                when N_Case_Statement =>
                   declare
                      Alt : Node_Id;
+
                   begin
                      Alt := First (Alternatives (Stat));
-
                      while Present (Alt) loop
                         Scop := First_Local_Scope (Statements (Alt));
 
@@ -4125,6 +4126,7 @@ package body Exp_Ch7 is
 
                when N_Subprogram_Body =>
                   Id := Defining_Entity (Stat);
+
                   if No (First_Ent) then
                      First_Ent := Id;
                   end if;
@@ -4156,8 +4158,7 @@ package body Exp_Ch7 is
         and then Present (H_Seq)
         and then Is_Compilation_Unit (Current_Scope)
       then
-         Ent :=
-           First_Local_Scope (Statements (H_Seq));
+         Ent := First_Local_Scope (Statements (H_Seq));
 
          --  There msy be subprograms declared in the exception handlers
          --  of the current body.
index 3c1bf360c25285f520be50acf0bdf391828659e6..9f428148266386810458893a912a2f4298bdb12b 100644 (file)
@@ -1168,8 +1168,9 @@ begin
          --  error message but do not print the internal 'usage' message.
 
          if GNATprove_Mode then
-            Write_Str ("one of the following is not a valid switch"
-                       & " or source file name: ");
+            Write_Str
+              ("one of the following is not a valid switch or source file "
+               & "name: ");
             Osint.Dump_Command_Line_Source_File_Names;
          else
             Usage;
index e540299a6c0a6d1652ab5841826fb5b09118b1d3..11e514d1b07b74b48a3e2784a6d64bbff010c75f 100644 (file)
@@ -2352,8 +2352,8 @@ package body Sem_Ch10 is
                Remove_Scope;
             end if;
 
-            if Nkind_In
-                 (Unit (Lib_Spec), N_Package_Body, N_Subprogram_Body)
+            if Nkind_In (Unit (Lib_Spec), N_Package_Body,
+                                          N_Subprogram_Body)
             then
                Remove_Context (Library_Unit (Lib_Spec));
             end if;
index fb8dff01cf6d31ee08dad88dc9c1d371148cb12f..0ed18febe490bc5abe853c6982ef45e9243e4ecc 100644 (file)
@@ -5708,6 +5708,7 @@ package body Sem_Ch13 is
                Assoc := First (Component_Associations (Expr));
                while Present (Assoc) loop
                   Analyze (Expression (Assoc));
+
                   if not Is_Entity_Name (Expression (Assoc)) then
                      Error_Msg_N ("value must be a function", Assoc);
                   end if;
@@ -9363,7 +9364,7 @@ package body Sem_Ch13 is
          --  The following aspect expressions may contain references to
          --  components and discriminants of the type.
 
-         elsif A_Id  = Aspect_Dynamic_Predicate
+         elsif A_Id = Aspect_Dynamic_Predicate
            or else A_Id = Aspect_Predicate
            or else A_Id = Aspect_Priority
          then
@@ -9375,7 +9376,8 @@ package body Sem_Ch13 is
             Preanalyze_Spec_Expression (End_Decl_Expr, T);
          end if;
 
-         Err := not Fully_Conformant_Expressions
+         Err :=
+           not Fully_Conformant_Expressions
                  (End_Decl_Expr, Freeze_Expr, Report => True);
       end if;
 
@@ -11239,8 +11241,8 @@ package body Sem_Ch13 is
         and then Scope (E) = Current_Scope
       then
          declare
+            A_Id  : Aspect_Id;
             Ritem : Node_Id;
-            A_Id : Aspect_Id;
 
          begin
             --  Look for aspect specification entries for this entity
@@ -11252,6 +11254,7 @@ package body Sem_Ch13 is
                  and then Is_Delayed_Aspect (Ritem)
                then
                   A_Id := Get_Aspect_Id (Ritem);
+
                   if A_Id = Aspect_Dynamic_Predicate
                     or else A_Id = Aspect_Predicate
                     or else A_Id = Aspect_Priority
@@ -11274,10 +11277,10 @@ package body Sem_Ch13 is
 
       end if;
 
-      --  For a record type, deal with variant parts. This has to be delayed
-      --  to this point, because of the issue of statically predicated
-      --  subtypes, which we have to ensure are frozen before checking
-      --  choices, since we need to have the static choice list set.
+      --  For a record type, deal with variant parts. This has to be delayed to
+      --  this point, because of the issue of statically predicated subtypes,
+      --  which we have to ensure are frozen before checking choices, since we
+      --  need to have the static choice list set.
 
       if Is_Record_Type (E) then
          Check_Variant_Part : declare
@@ -12456,15 +12459,35 @@ package body Sem_Ch13 is
       end if;
    end New_Stream_Subprogram;
 
+   --------------
+   -- Pop_Type --
+   --------------
+
+   procedure Pop_Type (E : Entity_Id) is
+   begin
+      if Ekind (E) = E_Record_Type and then E = Current_Scope then
+         End_Scope;
+
+      elsif Is_Type (E)
+        and then Has_Discriminants (E)
+        and then Nkind (Parent (E)) /= N_Subtype_Declaration
+      then
+         Uninstall_Discriminants (E);
+         Pop_Scope;
+      end if;
+   end Pop_Type;
+
    ---------------
    -- Push_Type --
    ---------------
 
    procedure Push_Type (E : Entity_Id) is
       Comp : Entity_Id;
+
    begin
       if Ekind (E) = E_Record_Type then
          Push_Scope (E);
+
          Comp := First_Component (E);
          while Present (Comp) loop
             Install_Entity (Comp);
@@ -12476,8 +12499,8 @@ package body Sem_Ch13 is
          end if;
 
       elsif Is_Type (E)
-         and then Has_Discriminants (E)
-         and then Nkind (Parent (E)) /= N_Subtype_Declaration
+        and then Has_Discriminants (E)
+        and then Nkind (Parent (E)) /= N_Subtype_Declaration
       then
          Push_Scope (E);
          Install_Discriminants (E);
@@ -12559,9 +12582,6 @@ package body Sem_Ch13 is
       N     : Node_Id;
       FOnly : Boolean := False) return Boolean
    is
-      S           : Entity_Id;
-      Parent_Type : Entity_Id;
-
       function Is_Derived_Type_With_Constraint return Boolean;
       --  Check whether T is a derived type with an explicit constraint, in
       --  which case the constraint has frozen the type and the item is too
@@ -12589,6 +12609,7 @@ package body Sem_Ch13 is
 
       function Is_Derived_Type_With_Constraint return Boolean is
          Decl : constant Node_Id := Declaration_Node (T);
+
       begin
          return Is_Derived_Type (T)
            and then Is_Frozen (Base_Type (T))
@@ -12623,14 +12644,19 @@ package body Sem_Ch13 is
          end if;
       end Too_Late;
 
+      --  Local variables
+
+      Parent_Type : Entity_Id;
+      S           : Entity_Id;
+
    --  Start of processing for Rep_Item_Too_Late
 
    begin
       --  First make sure entity is not frozen (RM 13.1(9))
 
       if (Is_Frozen (T)
-         or else (Is_Type (T)
-           and then Is_Derived_Type_With_Constraint))
+           or else (Is_Type (T)
+                     and then Is_Derived_Type_With_Constraint))
 
         --  Exclude imported types, which may be frozen if they appear in a
         --  representation clause for a local type.
@@ -13679,25 +13705,6 @@ package body Sem_Ch13 is
       end if;
    end Uninstall_Discriminants;
 
-   --------------
-   -- Pop_Type --
-   --------------
-
-   procedure Pop_Type (E : Entity_Id) is
-   begin
-      if Ekind (E) = E_Record_Type and then E = Current_Scope then
-         End_Scope;
-         return;
-
-      elsif Is_Type (E)
-         and then Has_Discriminants (E)
-         and then Nkind (Parent (E)) /= N_Subtype_Declaration
-      then
-         Uninstall_Discriminants (E);
-         Pop_Scope;
-      end if;
-   end Pop_Type;
-
    ------------------------------
    -- Validate_Address_Clauses --
    ------------------------------
index ee75ee42074098760cc75a6565c408ee8bb4fc2b..32c45614d42aa0b72cdbbc2bddfb689a6a29d90c 100644 (file)
@@ -8832,27 +8832,33 @@ package body Sem_Ch6 is
       --  for analysis and/or expansion to make things look as though they
       --  conform when they do not, e.g. by converting 1+2 into 3.
 
-      Result : Boolean;
-      function FCE (Given_E1, Given_E2 : Node_Id) return Boolean;
-      function FCE (Given_E1, Given_E2 : Node_Id) return Boolean is
-      begin
-         return Fully_Conformant_Expressions (Given_E1, Given_E2, Report);
-      end FCE;
+      function FCE (Given_E1 : Node_Id; Given_E2 : Node_Id) return Boolean;
+      --  ???
 
-      function FCL (L1, L2 : List_Id) return Boolean;
+      function FCL (L1 : List_Id; L2 : List_Id) return Boolean;
       --  Compare elements of two lists for conformance. Elements have to be
       --  conformant, and actuals inserted as default parameters do not match
       --  explicit actuals with the same value.
 
-      function FCO (Op_Node, Call_Node : Node_Id) return Boolean;
+      function FCO (Op_Node : Node_Id; Call_Node : Node_Id) return Boolean;
       --  Compare an operator node with a function call
 
+      ---------
+      -- FCE --
+      ---------
+
+      function FCE (Given_E1 : Node_Id; Given_E2 : Node_Id) return Boolean is
+      begin
+         return Fully_Conformant_Expressions (Given_E1, Given_E2, Report);
+      end FCE;
+
       ---------
       -- FCL --
       ---------
 
-      function FCL (L1, L2 : List_Id) return Boolean is
-         N1, N2 : Node_Id;
+      function FCL (L1 : List_Id; L2 : List_Id) return Boolean is
+         N1 : Node_Id;
+         N2 : Node_Id;
 
       begin
          if L1 = No_List then
@@ -8892,7 +8898,7 @@ package body Sem_Ch6 is
       -- FCO --
       ---------
 
-      function FCO (Op_Node, Call_Node : Node_Id) return Boolean is
+      function FCO (Op_Node : Node_Id; Call_Node : Node_Id) return Boolean is
          Actuals : constant List_Id := Parameter_Associations (Call_Node);
          Act     : Node_Id;
 
@@ -8919,6 +8925,10 @@ package body Sem_Ch6 is
          end if;
       end FCO;
 
+      --  Local variables
+
+      Result : Boolean;
+
    --  Start of processing for Fully_Conformant_Expressions
 
    begin
index d85f847ed49f9aedce9341de8014189f17482c29..50045170fde9edc6135d85bc956a09c50a0b029e 100644 (file)
@@ -2737,10 +2737,11 @@ package body Sem_Ch7 is
          --  to the same freeze node as their corresponding full view, if any.
          --  But we ought not to overwrite a node already inserted in the tree.
 
-         pragma Assert (Serious_Errors_Detected /= 0
-           or else No (Freeze_Node (Priv))
-           or else No (Parent (Freeze_Node (Priv)))
-           or else Freeze_Node (Priv) = Freeze_Node (Full));
+         pragma Assert
+           (Serious_Errors_Detected /= 0
+             or else No (Freeze_Node (Priv))
+             or else No (Parent (Freeze_Node (Priv)))
+             or else Freeze_Node (Priv) = Freeze_Node (Full));
 
          Set_Freeze_Node (Priv, Freeze_Node (Full));
 
index 120f1015bb5ef63263159a0ea6e521bcc6054869..4f8bec38aaf306f39ebf4ff625df8479df785b87 100644 (file)
@@ -14137,11 +14137,11 @@ package body Sem_Util is
          Deref := Expression (Deref);
       end if;
 
-      --  Ada 2005: If we have a component or slice of a dereference,
-      --  something like X.all.Y (2), and the type of X is access-to-constant,
-      --  Is_Variable will return False, because it is indeed a constant
-      --  view. But it might be a view of a variable object, so we want the
-      --  following condition to be True in that case.
+      --  Ada 2005: If we have a component or slice of a dereference, something
+      --  like X.all.Y (2) and the type of X is access-to-constant, Is_Variable
+      --  will return False, because it is indeed a constant view. But it might
+      --  be a view of a variable object, so we want the following condition to
+      --  be True in that case.
 
       if Is_Variable (Object)
         or else Is_Variable (Deref)
@@ -14155,9 +14155,8 @@ package body Sem_Util is
             --  False (it could be a function selector in a prefix form call
             --  occurring in an iterator specification).
 
-            if not
-              Ekind_In
-                (Entity (Selector_Name (Object)), E_Component, E_Discriminant)
+            if not Ekind_In (Entity (Selector_Name (Object)), E_Component,
+                                                              E_Discriminant)
             then
                return False;
             end if;
@@ -14172,8 +14171,8 @@ package body Sem_Util is
             P := Original_Node (Prefix (Object));
             Prefix_Type := Etype (P);
 
-            --  If the prefix is a qualified expression, we want to look at
-            --  its operand.
+            --  If the prefix is a qualified expression, we want to look at its
+            --  operand.
 
             if Nkind (P) = N_Qualified_Expression then
                P := Expression (P);