Commit b68cf874 by Arnaud Charlet

[multiple changes]

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
parent ff1bedac
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> 2015-05-26 Yannick Moy <moy@adacore.com>
* sem_aux.adb, sem_aux.ads (Get_Low_Bound): Use Type_Low_Bound. * sem_aux.adb, sem_aux.ads (Get_Low_Bound): Use Type_Low_Bound.
......
...@@ -8856,7 +8856,9 @@ package body Exp_Ch6 is ...@@ -8856,7 +8856,9 @@ package body Exp_Ch6 is
Pass_Caller_Acc : Boolean := False; Pass_Caller_Acc : Boolean := False;
Res_Decl : Node_Id; Res_Decl : Node_Id;
Result_Subt : Entity_Id; Result_Subt : Entity_Id;
Definite : Boolean; -- True for definite function result subtype
Definite : Boolean;
-- True for definite function result subtype
begin begin
-- Step past qualification or unchecked conversion (the latter can occur -- Step past qualification or unchecked conversion (the latter can occur
......
...@@ -955,8 +955,8 @@ begin ...@@ -955,8 +955,8 @@ begin
end if; end if;
-- Call to get target parameters. Note that the actual interface -- Call to get target parameters. Note that the actual interface
-- routines in Tbuild here. They can't be in this procedure -- routines are in Tbuild. They can't be in this procedure because
-- because of accessibility issues. -- of accessibility issues.
Targparm.Get_Target_Parameters Targparm.Get_Target_Parameters
(System_Text => Source_Text (S), (System_Text => Source_Text (S),
......
...@@ -110,7 +110,7 @@ package body Restrict is ...@@ -110,7 +110,7 @@ package body Restrict is
No_Use_Of_Pragma : array (Pragma_Id) of Source_Ptr := No_Use_Of_Pragma : array (Pragma_Id) of Source_Ptr :=
(others => No_Location); (others => No_Location);
-- Source location of pragma No_Use_Of_Pragma for given pragma, a value -- 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 := No_Use_Of_Pragma_Warning : array (Pragma_Id) of Boolean :=
(others => False); (others => False);
...@@ -1571,9 +1571,9 @@ package body Restrict is ...@@ -1571,9 +1571,9 @@ package body Restrict is
procedure Set_Restriction_No_Specification_Of_Aspect (A_Id : Aspect_Id) is procedure Set_Restriction_No_Specification_Of_Aspect (A_Id : Aspect_Id) is
begin begin
No_Specification_Of_Aspect_Set := True;
No_Specification_Of_Aspects (A_Id) := System_Location; No_Specification_Of_Aspects (A_Id) := System_Location;
No_Specification_Of_Aspect_Warning (A_Id) := False; No_Specification_Of_Aspect_Warning (A_Id) := False;
No_Specification_Of_Aspect_Set := True;
end Set_Restriction_No_Specification_Of_Aspect; end Set_Restriction_No_Specification_Of_Aspect;
----------------------------------------- -----------------------------------------
...@@ -1624,8 +1624,8 @@ package body Restrict is ...@@ -1624,8 +1624,8 @@ package body Restrict is
procedure Set_Restriction_No_Use_Of_Pragma (A_Id : Pragma_Id) is procedure Set_Restriction_No_Use_Of_Pragma (A_Id : Pragma_Id) is
begin begin
No_Use_Of_Pragma_Set := True; 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 (A_Id) := System_Location;
No_Use_Of_Pragma_Warning (A_Id) := False;
end Set_Restriction_No_Use_Of_Pragma; end Set_Restriction_No_Use_Of_Pragma;
-------------------------------- --------------------------------
......
...@@ -985,8 +985,7 @@ package body Sem_Aux is ...@@ -985,8 +985,7 @@ package body Sem_Aux is
-- if any discriminant has a default, they all do. -- if any discriminant has a default, they all do.
elsif Has_Discriminants (T) then elsif Has_Discriminants (T) then
return Present return Present (Discriminant_Default_Value (First_Discriminant (T)));
(Discriminant_Default_Value (First_Discriminant (T)));
else else
return True; return True;
......
...@@ -306,6 +306,14 @@ package Sem_Aux is ...@@ -306,6 +306,14 @@ package Sem_Aux is
-- Ent is any entity. Returns True if Ent is a type entity where the type -- 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)). -- 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; function Is_Derived_Type (Ent : Entity_Id) return Boolean;
-- Determines if the given entity Ent is a derived type. Result is always -- Determines if the given entity Ent is a derived type. Result is always
-- false if argument is not a type. -- false if argument is not a type.
...@@ -315,14 +323,6 @@ package Sem_Aux is ...@@ -315,14 +323,6 @@ package Sem_Aux is
-- used to set the visibility of generic formals of a generic package -- used to set the visibility of generic formals of a generic package
-- declared with a box or with partial parameterization. -- 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; 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 -- 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 -- following predicate in that an untagged record with immutably limited
......
...@@ -2223,14 +2223,17 @@ package body Sem_Ch7 is ...@@ -2223,14 +2223,17 @@ package body Sem_Ch7 is
Replace_Elmt (Priv_Elmt, Full_View (Priv)); Replace_Elmt (Priv_Elmt, Full_View (Priv));
-- Ensure that both views of the dependent private subtype are -- 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 if In_Open_Scopes (Scope (Full_View (Priv))) then
Set_Is_Immediately_Visible (Priv); Set_Is_Immediately_Visible (Priv);
Set_Is_Immediately_Visible (Full_View (Priv));
end if; end if;
Exchange_Declarations (Priv); Exchange_Declarations (Priv);
Set_Is_Immediately_Visible
(Priv, In_Open_Scopes (Scope (Priv)));
Set_Is_Potentially_Use_Visible Set_Is_Potentially_Use_Visible
(Priv, Is_Potentially_Use_Visible (Node (Priv_Elmt))); (Priv, Is_Potentially_Use_Visible (Node (Priv_Elmt)));
......
...@@ -4230,8 +4230,9 @@ package body Sprint is ...@@ -4230,8 +4230,9 @@ package body Sprint is
Sprint_Node (X); Sprint_Node (X);
Set_Sloc (X, Old_Sloc); Set_Sloc (X, Old_Sloc);
-- Array subtypes. -- Array subtypes
-- Preserve Sloc of index subtypes, as above.
-- Preserve Sloc of index subtypes, as above
when E_Array_Subtype => when E_Array_Subtype =>
Write_Header (False); Write_Header (False);
......
...@@ -220,7 +220,7 @@ package body Targparm is ...@@ -220,7 +220,7 @@ package body Targparm is
procedure Collect_Name; procedure Collect_Name;
-- Scan a name starting at System_Text (P), and put Name in Name_Buffer, -- 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). -- just past the last character (which should be a right paren).
------------------ ------------------
......
...@@ -621,12 +621,12 @@ package Targparm is ...@@ -621,12 +621,12 @@ package Targparm is
type Set_NSA_Type is access procedure (Asp : Name_Id; OK : out Boolean); type Set_NSA_Type is access procedure (Asp : Name_Id; OK : out Boolean);
-- Parameter type for Get_Target_Parameters that records a Restriction -- 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. -- 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); type Set_NUA_Type is access procedure (Attr : Name_Id; OK : out Boolean);
-- Parameter type for Get_Target_Parameters that records a Restriction -- 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. -- 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); type Set_NUP_Type is access procedure (Prag : Name_Id; OK : out Boolean);
...@@ -646,13 +646,13 @@ package Targparm is ...@@ -646,13 +646,13 @@ package Targparm is
Set_NUP : Set_NUP_Type := null); Set_NUP : Set_NUP_Type := null);
-- Called at the start of execution to obtain target parameters from the -- Called at the start of execution to obtain target parameters from the
-- source of package System. The parameters provide the source text to be -- 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 -- subprograms Make_Id, Make_SC, and Set_NOD are left at their default
-- value of null, Get_Target_Parameters will ignore pragma Restrictions -- value of null, Get_Target_Parameters will ignore pragma Restrictions
-- No_Dependence lines, otherwise it will use these three subprograms to -- (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, -- 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) -- 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. -- pragma. Similarly for the NSA and NUA cases.
procedure Get_Target_Parameters procedure Get_Target_Parameters
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment