Commit 9e87a68d by Ed Schonberg Committed by Arnaud Charlet

sem_util.ads, [...] (Object_Access_Level): If the object is a dereference of a…

sem_util.ads, [...] (Object_Access_Level): If the object is a dereference of a local object R created as a reference to...

2007-04-06  Ed Schonberg  <schonberg@adacore.com>
	    Javier Miranda  <miranda@adacore.com>

	* sem_util.ads, sem_util.adb (Object_Access_Level): If the object is a
	dereference of a local object R created as a reference to another
	object O, use the access level of O.
	(Matches_Prefixed_View_Profile): Use common predicate Conforming_Types,
	rather than local Same_Formal_Type, to check whether protected operation
	overrides an inherited one.
	(Same_Formal_Type): New predicate, used when matching signatures of
	overriding synchronized operations, to handle the case when a formal
	has a type that is a generic actual.
	(Is_Aliased_View): Replace check on E_Task_Type and E_Protected_Type by
	predicate Is_Concurrent_Type. This ensures supportin case of subtypes.
	(Needs_One_Actual): New predicate, for Ada 2005 use, to resolve
	syntactic ambiguities involving indexing of function calls that return
	arrays.
	(Abstract_Interface_List): New subprogram that returns the list of
	abstract interfaces associated with a concurrent type or a
	concurrent record type.
	(Interface_Present_In_Parent): New subprogram used to check if a
	given type or some of its parents implement a given interface.
	(Collect_Abstract_Interfaces): Add support for concurrent types
	with interface types.
	(Has_Abstract_Interfaces): Add support for concurrent types with
	interface types.
	(Is_Parent): New subprogram that determines whether E1 is a parent
	of E2. For a concurrent type its parent is the first element of its
	list of interface types; for other types this function provides the
	same result than Is_Ancestor.
	(Enclosing_Subprogram): Add test for N_Extended_Return_Statement.
	(Collect_Synchronized_Interfaces): Removed because the subprogram
	Collect_Abstract_Interfaces provides this functionality.
	(Collect_Abstract_Interfaces): Minor update to give support to
	concurrent types and thus avoid undesired code duplication.
	(Get_Subprogram_Entity): Handle entry calls.
	(May_Be_Lvalue): Include actuals that appear as in-out parameters in
	entry calls.
	(Enter_Name): Do not give -gnatwh hiding warning for record component
	entities, they never result in hiding.

From-SVN: r123599
parent 3aba5ed5
......@@ -33,6 +33,10 @@ with Urealp; use Urealp;
package Sem_Util is
function Abstract_Interface_List (Typ : Entity_Id) return List_Id;
-- Given a type that implements interfaces look for its associated
-- definition node and return its list of interfaces.
procedure Add_Access_Type_To_Process (E : Entity_Id; A : Entity_Id);
-- Add A to the list of access types to process when expanding the
-- freeze node of E.
......@@ -140,12 +144,6 @@ package Sem_Util is
-- one subsidiary subtype of the type. These subprograms can only
-- appear after the type itself.
procedure Collect_Synchronized_Interfaces
(Typ : Entity_Id;
Ifaces_List : out Elist_Id);
-- Similar to Collect_Abstract_Interfaces, but tailored to task and
-- protected types.
function Compile_Time_Constraint_Error
(N : Node_Id;
Msg : String;
......@@ -598,12 +596,20 @@ package Sem_Util is
-- is a variable (in the Is_Variable sense) with a non-tagged type
-- target are considered view conversions and hence variables.
function Is_Parent
(E1 : Entity_Id;
E2 : Entity_Id) return Boolean;
-- Determine whether E1 is a parent of E2. For a concurrent type, the
-- parent is the first element of its list of interface types; for other
-- types, this function provides the same result as Is_Ancestor.
function Is_Partially_Initialized_Type (Typ : Entity_Id) return Boolean;
-- Typ is a type entity. This function returns true if this type is
-- partly initialized, meaning that an object of the type is at least
-- partly initialized (in particular in the record case, that at least
-- one field has an initialization expression). Note that initialization
-- resulting from the use of pragma Normalized_Scalars does not count.
-- one component has an initialization expression). Note that
-- initialization resulting from the use of pragma Normalized_Scalars does
-- not count.
function Is_Potentially_Persistent_Type (T : Entity_Id) return Boolean;
-- Determines if type T is a potentially persistent type. A potentially
......@@ -618,7 +624,7 @@ package Sem_Util is
-- body of a remote call interface package.
function Is_Remote_Access_To_Class_Wide_Type (E : Entity_Id) return Boolean;
-- Return True if E is a remote access-to-class-wide-limited_private type
-- Return True if E is a remote access-to-class-wide type
function Is_Remote_Access_To_Subprogram_Type (E : Entity_Id) return Boolean;
-- Return True if E is a remote access to subprogram type
......@@ -710,6 +716,11 @@ package Sem_Util is
-- to guarantee this in all cases. Note that it is more possible to give
-- correct answer if the tree is fully analyzed.
function Needs_One_Actual (E : Entity_Id) return Boolean;
-- Returns True if a function has defaults for all but its first
-- formal. Used in Ada 2005 mode to solve the syntactic ambiguity that
-- results from an indexing of a function call written in prefix form.
function New_External_Entity
(Kind : Entity_Kind;
Scope_Id : Entity_Id;
......
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