From: Arnaud Charlet Date: Tue, 26 May 2015 10:42:26 +0000 (+0200) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b68cf874f69d47c08479f4b0e7bcd1d55d65d06b;p=gcc.git [multiple changes] 2015-05-26 Robert Dewar * sem_ch3.adb, sem_aux.adb, sem_aux.ads, exp_ch6.adb, sprint.adb: Minor reformatting. 2015-05-26 Gary Dismukes * gnat1drv.adb, targparm.adb, targparm.ads, restrict.adb: Minor reformatting and typo fixes in comments. 2015-05-26 Ed Schonberg * 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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ee194fcd79d..0cd2ea7104f 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,19 @@ +2015-05-26 Robert Dewar + + * sem_ch3.adb, sem_aux.adb, sem_aux.ads, exp_ch6.adb, sprint.adb: + Minor reformatting. + +2015-05-26 Gary Dismukes + + * gnat1drv.adb, targparm.adb, targparm.ads, restrict.adb: Minor + reformatting and typo fixes in comments. + +2015-05-26 Ed Schonberg + + * 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 * sem_aux.adb, sem_aux.ads (Get_Low_Bound): Use Type_Low_Bound. diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 8172e1a2240..3645c76272b 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -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 diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index 709cf2d9412..662065ed0ee 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -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), diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb index 2dae272ebbc..8c0f90260d1 100644 --- a/gcc/ada/restrict.adb +++ b/gcc/ada/restrict.adb @@ -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; -------------------------------- diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb index fc83eb78ba9..ef88959cc6a 100644 --- a/gcc/ada/sem_aux.adb +++ b/gcc/ada/sem_aux.adb @@ -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; diff --git a/gcc/ada/sem_aux.ads b/gcc/ada/sem_aux.ads index a3e5e656682..e5e814514f7 100644 --- a/gcc/ada/sem_aux.ads +++ b/gcc/ada/sem_aux.ads @@ -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 diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 1940b3b4670..a46b651246b 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -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; diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 35ff6794f69..a23ffebaeb5 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -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))); diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb index 63a397da19a..b1def4b722a 100644 --- a/gcc/ada/sprint.adb +++ b/gcc/ada/sprint.adb @@ -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); diff --git a/gcc/ada/targparm.adb b/gcc/ada/targparm.adb index 562eb74e8c3..645193e2459 100644 --- a/gcc/ada/targparm.adb +++ b/gcc/ada/targparm.adb @@ -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). ------------------ diff --git a/gcc/ada/targparm.ads b/gcc/ada/targparm.ads index 18c6c577be6..a1b766153ee 100644 --- a/gcc/ada/targparm.ads +++ b/gcc/ada/targparm.ads @@ -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