[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 26 May 2015 10:42:26 +0000 (12:42 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 26 May 2015 10:42:26 +0000 (12:42 +0200)
2015-05-26  Robert Dewar  <dewar@adacore.com>

* sem_ch3.adb, sem_aux.adb, sem_aux.ads, exp_ch6.adb, sprint.adb:
Minor reformatting.

2015-05-26  Gary Dismukes  <dismukes@adacore.com>

* gnat1drv.adb, targparm.adb, targparm.ads, restrict.adb: Minor
reformatting and typo fixes in comments.

2015-05-26  Ed Schonberg  <schonberg@adacore.com>

* sem_ch7.adb (Swap_Private_Dependets): Set visibility of
the two views of a private dependent in two separate steps,
to ensure proper visibility in parent units analyzed for inlining.

From-SVN: r223682

gcc/ada/ChangeLog
gcc/ada/exp_ch6.adb
gcc/ada/gnat1drv.adb
gcc/ada/restrict.adb
gcc/ada/sem_aux.adb
gcc/ada/sem_aux.ads
gcc/ada/sem_ch3.adb
gcc/ada/sem_ch7.adb
gcc/ada/sprint.adb
gcc/ada/targparm.adb
gcc/ada/targparm.ads

index ee194fc..0cd2ea7 100644 (file)
@@ -1,3 +1,19 @@
+2015-05-26  Robert Dewar  <dewar@adacore.com>
+
+       * sem_ch3.adb, sem_aux.adb, sem_aux.ads, exp_ch6.adb, sprint.adb:
+       Minor reformatting.
+
+2015-05-26  Gary Dismukes  <dismukes@adacore.com>
+
+       * gnat1drv.adb, targparm.adb, targparm.ads, restrict.adb: Minor
+       reformatting and typo fixes in comments.
+
+2015-05-26  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch7.adb (Swap_Private_Dependets): Set visibility of
+       the two views of a private dependent in two separate steps,
+       to ensure proper visibility in parent units analyzed for inlining.
+
 2015-05-26  Yannick Moy  <moy@adacore.com>
 
        * sem_aux.adb, sem_aux.ads (Get_Low_Bound): Use Type_Low_Bound.
index 8172e1a..3645c76 100644 (file)
@@ -8856,7 +8856,9 @@ package body Exp_Ch6 is
       Pass_Caller_Acc : Boolean := False;
       Res_Decl        : Node_Id;
       Result_Subt     : Entity_Id;
-      Definite        : Boolean; -- True for definite function result subtype
+
+      Definite : Boolean;
+      --  True for definite function result subtype
 
    begin
       --  Step past qualification or unchecked conversion (the latter can occur
index 709cf2d..662065e 100644 (file)
@@ -955,8 +955,8 @@ begin
             end if;
 
             --  Call to get target parameters. Note that the actual interface
-            --  routines in Tbuild here. They can't be in this procedure
-            --  because of accessibility issues.
+            --  routines are in Tbuild. They can't be in this procedure because
+            --  of accessibility issues.
 
             Targparm.Get_Target_Parameters
               (System_Text  => Source_Text  (S),
index 2dae272..8c0f902 100644 (file)
@@ -110,7 +110,7 @@ package body Restrict is
    No_Use_Of_Pragma : array (Pragma_Id) of Source_Ptr :=
                         (others => No_Location);
    --  Source location of pragma No_Use_Of_Pragma for given pragma, a value
-   --  of Sysstem_Location indicates occurrence in system.ads.
+   --  of System_Location indicates occurrence in system.ads.
 
    No_Use_Of_Pragma_Warning : array (Pragma_Id) of Boolean :=
                                 (others => False);
@@ -1571,9 +1571,9 @@ package body Restrict is
 
    procedure Set_Restriction_No_Specification_Of_Aspect (A_Id : Aspect_Id) is
    begin
+      No_Specification_Of_Aspect_Set := True;
       No_Specification_Of_Aspects (A_Id) := System_Location;
       No_Specification_Of_Aspect_Warning (A_Id) := False;
-      No_Specification_Of_Aspect_Set := True;
    end Set_Restriction_No_Specification_Of_Aspect;
 
    -----------------------------------------
@@ -1624,8 +1624,8 @@ package body Restrict is
    procedure Set_Restriction_No_Use_Of_Pragma (A_Id : Pragma_Id) is
    begin
       No_Use_Of_Pragma_Set := True;
-      No_Use_Of_Pragma_Warning (A_Id) := False;
       No_Use_Of_Pragma (A_Id) := System_Location;
+      No_Use_Of_Pragma_Warning (A_Id) := False;
    end Set_Restriction_No_Use_Of_Pragma;
 
    --------------------------------
index fc83eb7..ef88959 100644 (file)
@@ -985,8 +985,7 @@ package body Sem_Aux is
       --  if any discriminant has a default, they all do.
 
       elsif Has_Discriminants (T) then
-         return Present
-                  (Discriminant_Default_Value (First_Discriminant (T)));
+         return Present (Discriminant_Default_Value (First_Discriminant (T)));
 
       else
          return True;
index a3e5e65..e5e8145 100644 (file)
@@ -306,6 +306,14 @@ package Sem_Aux is
    --  Ent is any entity. Returns True if Ent is a type entity where the type
    --  is required to be passed by reference, as defined in (RM 6.2(4-9)).
 
+   function Is_Definite_Subtype (T : Entity_Id) return Boolean;
+   --  T is a type entity. Returns True if T is a definite subtype.
+   --  Indefinite subtypes are unconstrained arrays, unconstrained
+   --  discriminated types without defaulted discriminants, class-wide types,
+   --  and types with unknown discriminants. Definite subtypes are all others
+   --  (elementary, constrained composites (including the case of records
+   --  without discriminants), and types with defaulted discriminants).
+
    function Is_Derived_Type (Ent : Entity_Id) return Boolean;
    --  Determines if the given entity Ent is a derived type. Result is always
    --  false if argument is not a type.
@@ -315,14 +323,6 @@ package Sem_Aux is
    --  used to set the visibility of generic formals of a generic package
    --  declared with a box or with partial parameterization.
 
-   function Is_Definite_Subtype (T : Entity_Id) return Boolean;
-   --  T is a type entity. Returns True if T is a definite subtype.
-   --  Indefinite subtypes are unconstrained arrays, unconstrained
-   --  discriminated types without defaulted discriminants, class-wide types,
-   --  and types with unknown discriminants. Definite subtypes are all others
-   --  (elementary, constrained composites (including the case of records
-   --  without discriminants), and types with defaulted discriminants).
-
    function Is_Immutably_Limited_Type (Ent : Entity_Id) return Boolean;
    --  Implements definition in Ada 2012 RM-7.5 (8.1/3). This differs from the
    --  following predicate in that an untagged record with immutably limited
index 1940b3b..a46b651 100644 (file)
@@ -4264,7 +4264,7 @@ package body Sem_Ch3 is
            and then not Is_Constrained (T)
            and then Has_Discriminants (T)
            and then (Ada_Version < Ada_2005
-                       or else not Is_Definite_Subtype (T))
+                      or else not Is_Definite_Subtype (T))
          then
             Set_Actual_Subtype (Id, Build_Default_Subtype (T, N));
          end if;
index 35ff679..a23ffeb 100644 (file)
@@ -2223,14 +2223,17 @@ package body Sem_Ch7 is
                Replace_Elmt (Priv_Elmt, Full_View (Priv));
 
                --  Ensure that both views of the dependent private subtype are
-               --  immediately visible if within some open scope.
+               --  immediately visible if within some open scope. Check full
+               --  view before exchanging views.
 
                if In_Open_Scopes (Scope (Full_View (Priv))) then
                   Set_Is_Immediately_Visible (Priv);
-                  Set_Is_Immediately_Visible (Full_View (Priv));
                end if;
 
                Exchange_Declarations (Priv);
+               Set_Is_Immediately_Visible
+                 (Priv, In_Open_Scopes (Scope (Priv)));
+
                Set_Is_Potentially_Use_Visible
                  (Priv, Is_Potentially_Use_Visible (Node (Priv_Elmt)));
 
index 63a397d..b1def4b 100644 (file)
@@ -4230,8 +4230,9 @@ package body Sprint is
                      Sprint_Node (X);
                      Set_Sloc (X, Old_Sloc);
 
-                     --  Array subtypes.
-                     --  Preserve Sloc of index subtypes, as above.
+                     --  Array subtypes
+
+                     --  Preserve Sloc of index subtypes, as above
 
                   when E_Array_Subtype =>
                      Write_Header (False);
index 562eb74..645193e 100644 (file)
@@ -220,7 +220,7 @@ package body Targparm is
 
       procedure Collect_Name;
       --  Scan a name starting at System_Text (P), and put Name in Name_Buffer,
-      --  with Name_Len being length, folded to lower case. On return P points
+      --  with Name_Len being length, folded to lower case. On return, P points
       --  just past the last character (which should be a right paren).
 
       ------------------
index 18c6c57..a1b7661 100644 (file)
@@ -621,12 +621,12 @@ package Targparm is
 
    type Set_NSA_Type is access procedure (Asp : Name_Id; OK : out Boolean);
    --  Parameter type for Get_Target_Parameters that records a Restriction
-   --  No_Specificaztion_Of_Aspect. Asp is the pragma name. OK is set True
+   --  No_Specification_Of_Aspect. Asp is the aspect name. OK is set True
    --  if this is an OK aspect name, and False if it is not an aspect name.
 
    type Set_NUA_Type is access procedure (Attr : Name_Id; OK : out Boolean);
    --  Parameter type for Get_Target_Parameters that records a Restriction
-   --  No_Use_Of_Attribute. Prag is the attribute name. OK is set True if
+   --  No_Use_Of_Attribute. Attr is the attribute name. OK is set True if
    --  this is an OK attribute name, and False if it is not an attribute name.
 
    type Set_NUP_Type is access procedure (Prag : Name_Id; OK : out Boolean);
@@ -646,13 +646,13 @@ package Targparm is
       Set_NUP      : Set_NUP_Type := null);
    --  Called at the start of execution to obtain target parameters from the
    --  source of package System. The parameters provide the source text to be
-   --  scanned (in System_Text (Source_First .. Source_Last)). if the three
+   --  scanned (in System_Text (Source_First .. Source_Last)). If the three
    --  subprograms Make_Id, Make_SC, and Set_NOD are left at their default
    --  value of null, Get_Target_Parameters will ignore pragma Restrictions
-   --  No_Dependence lines, otherwise it will use these three subprograms to
-   --  record them. Similarly if Set_NUP is left at its default value of null,
+   --  (No_Dependence) lines; otherwise it will use these three subprograms to
+   --  record them. Similarly, if Set_NUP is left at its default value of null,
    --  then any occurrences of pragma Restrictions (No_Use_Of_Pragma => XXX)
-   --  will be ignored, otherwise it will use this procedure to record the
+   --  will be ignored; otherwise it will use this procedure to record the
    --  pragma. Similarly for the NSA and NUA cases.
 
    procedure Get_Target_Parameters