[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 14 Jun 2016 12:36:01 +0000 (14:36 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 14 Jun 2016 12:36:01 +0000 (14:36 +0200)
2016-06-14  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_ch7.adb, sem_ch12.adb, freeze.adb, lib-xref.ads, exp_ch3.adb:
Minor reformatting.

2016-06-14  Bob Duff  <duff@adacore.com>

* sem_elab.adb: Do nothing if the callee is intrinsic.
* sinfo.ads, einfo.ads: Minor comment fixes.

From-SVN: r237436

gcc/ada/ChangeLog
gcc/ada/einfo.ads
gcc/ada/exp_ch3.adb
gcc/ada/freeze.adb
gcc/ada/lib-xref.ads
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch7.adb
gcc/ada/sem_elab.adb
gcc/ada/sinfo.ads

index cedc298..26b488a 100644 (file)
@@ -1,3 +1,13 @@
+2016-06-14  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_ch7.adb, sem_ch12.adb, freeze.adb, lib-xref.ads, exp_ch3.adb:
+       Minor reformatting.
+
+2016-06-14  Bob Duff  <duff@adacore.com>
+
+       * sem_elab.adb: Do nothing if the callee is intrinsic.
+       * sinfo.ads, einfo.ads: Minor comment fixes.
+
 2016-06-14  Ed Schonberg  <schonberg@adacore.com>
 
        * contracts.adb (Has_Null_Body): Move to sem_util, for general
index 405455d..19e4087 100644 (file)
@@ -2675,13 +2675,14 @@ package Einfo is
 
 --    Is_Intrinsic_Subprogram (Flag64)
 --       Defined in functions and procedures. It is set if a valid pragma
---       Interface or Import is present for this subprogram specifying pragma
---       Intrinsic. Valid means that the name and profile of the subprogram
---       match the requirements of one of the recognized intrinsic subprograms
---       (see package Sem_Intr for details). Note: the value of Convention for
---       such an entity will be set to Convention_Intrinsic, but it is the
---       setting of Is_Intrinsic_Subprogram, NOT simply having convention set
---       to intrinsic, which causes intrinsic code to be generated.
+--       Interface or Import is present for this subprogram specifying
+--       convention Intrinsic. Valid means that the name and profile of the
+--       subprogram match the requirements of one of the recognized intrinsic
+--       subprograms (see package Sem_Intr for details). Note: the value of
+--       Convention for such an entity will be set to Convention_Intrinsic,
+--       but it is the setting of Is_Intrinsic_Subprogram, NOT simply having
+--       convention set to intrinsic, which causes intrinsic code to be
+--       generated.
 
 --    Is_Invariant_Procedure (Flag257)
 --       Defined in functions and procedures. Set for a generated invariant
index 3213b5d..7f98b91 100644 (file)
@@ -3700,28 +3700,28 @@ package body Exp_Ch3 is
       --  Recursive procedure that generates a list of checks for components
       --  that need it, and recurses through variant parts when present.
 
-      function Build_Component_Invariant_Call (Comp : Entity_Id)
-      return Node_Id;
-      --  Build call to invariant procedure for a record component.
+      function Build_Component_Invariant_Call
+        (Comp : Entity_Id) return Node_Id;
+      --  Build call to invariant procedure for a record component
 
       ------------------------------------
       -- Build_Component_Invariant_Call --
       ------------------------------------
 
-      function Build_Component_Invariant_Call (Comp : Entity_Id)
-      return Node_Id
+      function Build_Component_Invariant_Call
+        (Comp : Entity_Id) return Node_Id
       is
-         Sel_Comp : Node_Id;
-         Typ      : Entity_Id;
          Call     : Node_Id;
          Proc     : Entity_Id;
+         Sel_Comp : Node_Id;
+         Typ      : Entity_Id;
 
       begin
          Typ := Etype (Comp);
 
          Sel_Comp :=
            Make_Selected_Component (Loc,
-             Prefix      => New_Occurrence_Of (Object_Entity, Loc),
+             Prefix        => New_Occurrence_Of (Object_Entity, Loc),
              Selector_Name => New_Occurrence_Of (Comp, Loc));
 
          if Is_Access_Type (Typ) then
@@ -3759,13 +3759,14 @@ package body Exp_Ch3 is
          if Is_Access_Type (Etype (Comp)) then
             Call :=
               Make_If_Statement (Loc,
-                Condition =>
+                Condition       =>
                   Make_Op_Ne (Loc,
                     Left_Opnd   => Make_Null (Loc),
                     Right_Opnd  =>
-                       Make_Selected_Component (Loc,
-                         Prefix      => New_Occurrence_Of (Object_Entity, Loc),
-                         Selector_Name => New_Occurrence_Of (Comp, Loc))),
+                      Make_Selected_Component (Loc,
+                        Prefix        =>
+                          New_Occurrence_Of (Object_Entity, Loc),
+                        Selector_Name => New_Occurrence_Of (Comp, Loc))),
                 Then_Statements => New_List (Call));
          end if;
 
@@ -4620,10 +4621,8 @@ package body Exp_Ch3 is
 
          Propagate_Type_Has_Flags (Base, Comp_Typ);
          Set_Has_Controlled_Component
-                              (Base, Has_Controlled_Component
-                                                 (Comp_Typ)
-                                       or else
-                                     Is_Controlled (Comp_Typ));
+           (Base, Has_Controlled_Component (Comp_Typ)
+                    or else Is_Controlled (Comp_Typ));
 
          if No (Init_Proc (Base)) then
 
index ff3f063..046fd15 100644 (file)
@@ -1161,11 +1161,13 @@ package body Freeze is
       ADC              : Node_Id;
       Comp_ADC_Present : out Boolean)
    is
-      Encl_Base : Entity_Id;
       Comp_Base : Entity_Id;
       Comp_ADC  : Node_Id;
+      Encl_Base : Entity_Id;
       Err_Node  : Node_Id;
 
+      Component_Aliased : Boolean;
+
       Comp_Byte_Aligned : Boolean;
       --  Set for the record case, True if Comp starts on a byte boundary
       --  (in which case it is allowed to have different storage order).
@@ -1174,8 +1176,6 @@ package body Freeze is
       --  Set True when the component is a nested composite, and it does not
       --  have the same scalar storage order as Encl_Type.
 
-      Component_Aliased : Boolean;
-
    begin
       --  Record case
 
@@ -1226,9 +1226,9 @@ package body Freeze is
          Comp_Base := Underlying_Type (Comp_Base);
       end if;
 
-      Comp_ADC := Get_Attribute_Definition_Clause
-                    (First_Subtype (Comp_Base),
-                     Attribute_Scalar_Storage_Order);
+      Comp_ADC :=
+        Get_Attribute_Definition_Clause
+          (First_Subtype (Comp_Base), Attribute_Scalar_Storage_Order);
       Comp_ADC_Present := Present (Comp_ADC);
 
       --  Case of record or array component: check storage order compatibility.
@@ -1240,9 +1240,8 @@ package body Freeze is
         or else Is_Array_Type (Comp_Base)
       then
          Comp_SSO_Differs :=
-           Reverse_Storage_Order (Encl_Base)
-             /=
-           Reverse_Storage_Order (Comp_Base);
+           Reverse_Storage_Order (Encl_Base) /=
+             Reverse_Storage_Order (Comp_Base);
 
          --  Parent and extension must have same storage order
 
index 4095008..a6b9676 100644 (file)
@@ -614,9 +614,9 @@ package Lib.Xref is
    --  This procedure is called from Frontend to process these table entries
 
    function Has_Deferred_Reference (Ent : Entity_Id) return Boolean;
-   --  This function determines whether an entity has a pending reference, in
-   --  order to suppress premature warnings about useless assignments. See
-   --  comments in Analyze_Assignment in sem-ch5.adb.
+   --  Determine whether arbitrary entity Ent has a pending reference in order
+   --  to suppress premature warnings about useless assignments. See comments
+   --  in Analyze_Assignment in sem_ch5.adb.
 
    -----------------------------
    -- SPARK Xrefs Information --
index 6c0567e..5d5e2dd 100644 (file)
@@ -1500,9 +1500,8 @@ package body Sem_Ch12 is
          --  correspond to some formal in the generic.
 
          if Nkind (Named) /= N_Others_Choice
-           and then
-             (Present (Explicit_Generic_Actual_Parameter (Named))
-               or else Box_Present (Named))
+           and then (Present (Explicit_Generic_Actual_Parameter (Named))
+                      or else Box_Present (Named))
          then
             Num_Actuals := Num_Actuals + 1;
          end if;
index bb47589..8c318fd 100644 (file)
@@ -2586,7 +2586,7 @@ package body Sem_Ch7 is
                               (Priv, Finalize_Storage_Only
                                                    (Base_Type (Full)));
             Propagate_Type_Has_Flags
-                              (Priv, Base_Type (Full));
+                              (Priv,                Base_Type (Full));
             Set_Has_Controlled_Component
                               (Priv, Has_Controlled_Component
                                                    (Base_Type (Full)));
index 2b2747e..783f6dd 100644 (file)
@@ -641,6 +641,13 @@ package body Sem_Elab is
          return;
       end if;
 
+      --  Intrinsics such as instances of Unchecked_Deallocation do not have
+      --  any body, so elaboration checking is not needed, and would be wrong.
+
+      if Is_Intrinsic_Subprogram (E) then
+         return;
+      end if;
+
       --  Proceed with check
 
       Ent := E;
index d27cb73..4e8d51a 100644 (file)
@@ -4119,7 +4119,7 @@ package Sinfo is
       --  treated as though it were Empty) if No_Initialization is set True.
 
       --------------------------------------
-      -- 4.5  Short Circuit Control Forms --
+      -- 4.5  Short-Circuit Control Forms --
       --------------------------------------
 
       --  EXPRESSION ::=
@@ -7677,7 +7677,7 @@ package Sinfo is
       -----------------------------
 
       --  This node is created by the analyzer/expander to handle some
-      --  expansion cases, notably short circuit forms where there are
+      --  expansion cases, notably short-circuit forms where there are
       --  actions associated with the right-hand side operand.
 
       --  The N_Expression_With_Actions node represents an expression with
@@ -7884,17 +7884,15 @@ package Sinfo is
       --  same as the type of the subexpression which it replaces.
 
       --  If Condition is empty, then the raise is unconditional. If the
-      --  Condition field is non-empty, it is a boolean expression which
-      --  is first evaluated, and the exception is raised only if the
-      --  value of the expression is True. In the unconditional case, the
-      --  creation of this node is usually accompanied by a warning message
-      --  error. The creation of this node will usually be accompanied by a
-      --  message (unless it appears within the right operand of a short
-      --  circuit form whose left argument is static and decisively
-      --  eliminates elaboration of the raise operation. The condition field
-      --  can ONLY be present when the node is used as a statement form, it
-      --  may NOT be present in the case where the node appears within an
-      --  expression.
+      --  Condition field is non-empty, it is a boolean expression which is
+      --  first evaluated, and the exception is raised only if the value of the
+      --  expression is True. In the unconditional case, the creation of this
+      --  node is usually accompanied by a warning message (unless it appears
+      --  within the right operand of a short-circuit form whose left argument
+      --  is static and decisively eliminates elaboration of the raise
+      --  operation). The condition field can ONLY be present when the node is
+      --  used as a statement form; it must NOT be present in the case where
+      --  the node appears within an expression.
 
       --  The exception is generated with a message that contains the
       --  file name and line number, and then appended text. The Reason