einfo.ads, einfo.adb (Available_View): New synthesized attribute applicable to types...
authorJavier Miranda <miranda@adacore.com>
Wed, 6 Jun 2007 10:23:15 +0000 (12:23 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 6 Jun 2007 10:23:15 +0000 (12:23 +0200)
commit0a36105d5657dd7126160c5bae2b9b68af63fcff
tree532cf462f398cdea81f9b2907d3cf7b3ad43c7dd
parent109949cd3ca2200473c776d19996d72af3a5c6e7
einfo.ads, einfo.adb (Available_View): New synthesized attribute applicable to types that have the With_Type flag set.

2007-04-20  Javier Miranda  <miranda@adacore.com>
    Ed Schonberg  <schonberg@adacore.com>
    Robert Dewar  <dewar@adacore.com>
    Eric Botcazou  <ebotcazou@adacore.com>
    Arnaud Charlet  <charlet@adacore.com>

* einfo.ads, einfo.adb (Available_View): New synthesized attribute
applicable to types that have the With_Type flag set. Returns the
non-limited view of the type, if available, otherwise the type itself.
For class-wide types, there is no direct link in the tree, so we have
to retrieve the class-wide type of the non-limited view of the Etype.
New attributes Static_Initialization and Static_Elaboration_Desired.
Remove the pragma Thread_Body, and the associated flag
Is_Thread_Body in entities, and all related code.
(Suppress_Value_Tracking_On_Call): New flag
E_Exception has Esize and Alignment fields
(Universal_Aliasing): New function.
(Set_Universal_Aliasing): New procedure.
(Write_Entity_Flags): Deal with Universal_Aliasing flag.
(Check_Nested_Access): New procedure.
(Has_Up_Level_Access, Set_Has_Up_Level_Access): New procedures.
(Find_Direct_Name, Note_Possible_Modification): Use Check_Nested_Access.
(Related_Interface): New attribute. Present in dispatch table pointer
components of records. Set to point to the entity of the corresponding
interface type.
(Is_By_Reference_Type): Recurse on the full view of an incomplete type.
(Original_Access_Type): Remove, not needed.
(Root_Type): Handle properly subtypes of class-wide-types.
Update comments.

* sem_ch4.adb (Analyze_Explicit_Dereference): Add support for
class-wide types visible through limited-with clauses.
(Try_Primitive_Operation): When examining all primitive operations of a
tagged type, do not consider subprograms labeled as hidden unless they
belong to a private generic type with a tagged parent.
(Try_Object_Operation): Extensive rewriting, to handle properly various
overloading cases, when several ancestors may have class-wide operations
that are possible candidates, and when the overloaded functions return
array types and have defaulted parameters so that the call may be
interpreted as an indexing.
(Analyze_Allocator): Remove Mark_Allocator and its invocation.
(Process_Function_Call): use Next, rather than Next_Actual, to analyze
successive actuals before analyzing the call itself.
(Try_Primitive_Operation): A primitive operation is compatible with the
prefix if the prefix has a synchronized type and the type of the formal
is its corresponding record, as can be the case when the primitive
operation is declared outside of the body of the type.
(Traverse_Homonyms): New subprocedure of Try_Class_Wide_Operation, to
perform homonym traversal, looking for class-wide operation matches
(formerly done in statements of Try_Class_Wide_Operation). Matches on
access parameters are now restricted to anonymous access types.
(Mark_Allocator): An allocator with a discriminant association parent is
a coextension.
(Try_One_Prefix_Interpretation): If the type of the object is
incomplete, as can be happen when it is a limited view obtained through
a limited_with_clause, the selected component is not part of a prefixed
call.
(Complete_Object_Operation): Diagnose properly an object that is not
aliased when the corresponding controlling formal is an access
parameter.
(Try_Primitive_Operation, Try_Class_Wide_Operation): Diagnose properly
ambiguous calls in prefixed notation, where two primitives differ only
in that the controlling argument of one is an access parameter.

* sem_ch6.adb (Has_Single_Return): Add guard in code that determines
whether a function that returns an unconstrained type can be inlined.
(Process_Formals): Diagnose properly the illegal use of an incomplete
type in the profile of an access_to_subprogram declaration.
(Check_Synchronized_Overriding): Nothing check for concurrent types, the
operations are attached to the corresponding record.
(Analyze_Subprogram_Specification): Add variables Formal and Formal_Typ.
When processing a primitive of a concurrent type which implements an
interface change the type of all controlling formals to that of the
corresponding record type.
(Check_Synchronized_Overriding): Relax the conditional logic when trying
to determine the tagged type to which a primitive belongs.
(Check_Conventions): Capture condition to ignore a primitive operation
(which is shared between the loop in Check_Conventions and the one in
Check_Convention) in a new local function Skip_Check.
(Check_Convention): Rename Prim_Op to Second_Prim_Op to avoid possible
confusion with Check_Conventions' own Prim_Op local variable.
(Create_Extra_Formals): Test for a tagged result type rather than a
controlling result when determining whether to add a BIP_Alloc_Form
formal and a BIP_Final_List formal to the function.
(Check_Conformance); For parameters that are anonymous access types,
subtype conformance requires that the not null and the constant
indicators must match
(Check_Synchronized_Overriding): New parameter Formal_Typ. Add machinery
to retrieve the appropriate type when processing a concurrent type
declared within a generic. Minor comment reformatting. Change invocation
of Overrides_Synchronized_Primitive to Find_Overridden_Synchronized_Pri-
mitive.
(Analyze_Subprogram_Body): If the return type of a function is an
anonymous access to the limited view of a class-wide type, and the
non-limited view of the type is available, update the type of the
function so that code can be generated.
(Process_Formals): In case of access-subtype itype whose designated
type is also an itype (situation that happens now with access to
subprograms) we mark the access-type itype with the Has_Delayed_Freeze
attribute to avoid backend problems.
(Check_Return_Subtype_Indication): Replace R_Type with R_Stm_Type in
init of R_Stm_Type_Is_Anon_Access. Also check that base types of the
anonymous types' designated types are same before testing
Subtypes_Statically_Match.
(Create_Extra_Formals): Test for a named access parameter that is a
controlling formal as an additional condition for adding an
accessibility level formal. This can occur in the subp type created for
dispatching calls in Expand_Dispatching_Call, and allows calling
Create_Extra_Formals from that procedure rather than special-casing the
extra formals there.
(Create_Extra_Formals): Add BIP_Alloc_Form and BIP_Final_List formals
when the function has a controlling result.
(Check_Returns): Add much more knowledge of the optimization of local
raise statements to gotos, to retain proper warnings in this case.
(Check_Statement_Sequence): Ignore N_Push_xxx_Label and N_Pop_xxx_Label
nodes when looking for last statement.

* sem_type.ads, sem_type.adb (Specific_Type): Add support for
class-wide types visible through limited with clauses.
(Add_One_Interp): If the operands are anonymous access types, the
predefined operator on universal_access is immediately visibles
(Find_Unique_Type): Handle anonymous access to subprogram types just as
other anonymous access types.
(Disambiguate): Take into account CIL convention.
(Interface_Present_In_Ancestor): Add support for class-wide interfaces.

From-SVN: r125390
gcc/ada/einfo.adb
gcc/ada/einfo.ads
gcc/ada/sem_ch4.adb
gcc/ada/sem_ch6.adb
gcc/ada/sem_type.adb
gcc/ada/sem_type.ads