diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-06 09:19:10 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-06 09:19:10 +0000 |
commit | 21ec6442052f5a2c9f387418cf82e808b8beb8ba (patch) | |
tree | 12ed0014102d78ce0433f132d50d7cdaeaa18628 /gcc/ada/sem_ch6.ads | |
parent | 92ad093e4ea3aea8784fc37dd83394ac0effcc2e (diff) | |
download | gcc-21ec6442052f5a2c9f387418cf82e808b8beb8ba.tar.gz |
2007-04-06 Robert Dewar <dewar@adacore.com>
Thomas Quinot <quinot@adacore.com>
Ed Schonberg <schonberg@adacore.com>
Bob Duff <duff@adacore.com>
* einfo.ads, einfo.adb: (First_Component_Or_Discriminant): New function
(Next_Component_Or_Discriminant): New function and procedure
(First_Index, First_Literal, Master_Id,
Set_First_Index, Set_First_Literal, Set_Master_Id):
Add missing Ekind assertions.
(Is_Access_Protected_Subprogram_Type): New predicate.
(Has_RACW): New entity flag, set on package entities to indicate that
the package contains the declaration of a remote accecss-to-classwide
type.
(E_Return_Statement): This node type has the Finalization_Chain_Entity
attribute, in case the result type has controlled parts.
(Requires_Overriding): Add this new flag, because "requires
overriding" is subtly different from "is abstract" (see AI-228).
(Is_Abstract): Split Is_Abstract flag into Is_Abstract_Subprogram and
Is_Abstract_Type. Make sure these are called only when appropriate.
(Has_Pragma_Unreferenced_Objects): New flag
* exp_ch5.adb (Expand_N_Assignment_Statement): If the left-hand side is
class-wide, the tag of the right-hand side must be an exact match, not
an ancestor of that of the object on left-hand side.
(Move_Activation_Chain): New procedure to create the call to
System.Tasking.Stages.Move_Activation_Chain.
(Expand_N_Extended_Return_Statement): Generate code to call
System.Finalization_Implementation.Move_Final_List at the end of a
return statement if the function's result type has controlled parts.
Move asserts to Build_In_Place_Formal.
(Move_Final_List): New function to create the call statement.
(Expand_N_Assignment_Statement): In case of assignment to a class-wide
tagged type, replace generation of call to the run-time subprogram
CW_Membership by call to Build_CW_Membership.
(Expand_N_Return_Statement): Replace generation of call to the run-time
subprogram Get_Access_Level by call to Build_Get_Access_Level.
(Expand_N_Simple_Function_Return): Replace generation of call to the
run-time subprogram Get_Access_Level by call to Build_Get_Access_Level.
* exp_ch6.ads, exp_ch6.adb (Expand_Call): Use new predicate
Is_Access_Protected_Subprogram_Type, to handle both named and anonymous
access to protected operations.
(Add_Task_Actuals_To_Build_In_Place_Call): New procedure to add the
master and chain actual parameters to a build-in-place function call
involving tasks.
(BIP_Formal_Suffix): Add new enumeration literals to complete the case
statement.
(Make_Build_In_Place_Call_In_Allocator,
Make_Build_In_Place_Call_In_Anonymous_Context,
Make_Build_In_Place_Call_In_Assignment,
Make_Build_In_Place_Call_In_Object_Declaration): Call
Add_Task_Actuals_To_Build_In_Place_Call with the appropriate master.
(Expand_Inlined_Call): If the subprogram is a null procedure, or a
stubbed procedure with a null body, replace the call with a null
statement without using the full inlining machinery, for efficiency
and to avoid invalid values in source file table entries.
* exp_ch8.adb (Expand_N_Object_Renaming_Declaration): Add support for
renamings of calls to build-in-place functions.
* rtsfind.adb (RTE_Record_Component_Available): New subprogram that
provides the functionality of RTE_Available to record components.
(RTU_Entity): The function Entity has been renamed to RTU_Entity
to avoid undesired overloading.
(Entity): New subprogram that returns the entity for the referened
unit. If this unit has not been loaded, it returns Empty.
(RE_Activation_Chain_Access, RE_Move_Activation_Chain): New entities.
Remove no longer used entities.
(RE_Finalizable_Ptr_Ptr, RE_Move_Final_List): New entities.
(RE_Type_Specific_Data): New entity.
(RE_Move_Any_Value): New entity.
(RE_TA_A, RE_Get_Any_Type): New entities.
(RE_Access_Level, RE_Dispatch_Table, E_Default_Prim_Op_Count,
RE_Prims_Ptr, RE_RC_Offset, RE_Remotely_Callable,
RE_DT_Typeinfo_Ptr_Size, RE_Cstring_Ptr, RE_DT_Expanded_Name): Added.
(Entity): New subprogram that returns the entity for the referened
unit. If this unit has not been loaded, it returns Empty.
(RTE): Addition of a new formal that extends the search to the scopes
of the record types found in the chain of the package.
* sem_ch6.ads, sem_ch6.adb (Check_Overriding_Indicator): Print
"abstract subprograms must be visible" message, whether or not the type
is an interface; that is, remove the special case for interface types.
(Analyze_Function_Return): Remove error message "return of task objects
is not yet implemented" because this is now implemented.
(Create_Extra_Formals): Add the extra master and activation chain
formals in case the result type has tasks.
Remove error message "return of limited controlled objects is not yet
implemented".
(Create_Extra_Formals): Add the extra caller's finalization list formal
in case the result type has controlled parts.
(Process_Formals): In case of access formal types there is no need
to continue with the analysis of the formals if we already notified
errors.
(Check_Overriding_Indicator): Add code to check overriding of predefined
operators.
(Create_Extra_Formals): Prevent creation of useless Extra_Constrained
flags for formals that do not require them,.
(Enter_Overloaded_Entity): Do not give -gnatwh warning message unless
hidden entity is use visible or directly visible.
(Analyze_Abstract_Subprogram_Declaration,Analyze_Subprogram_Body,
Analyze_Subprogram_Declaration,Analyze_Subprogram_Specification,
Check_Conventions,Check_Delayed_Subprogram,Make_Inequality_Operator,
New_Overloaded_Entity): Split Is_Abstract flag into
Is_Abstract_Subprogram and Is_Abstract_Type.
* s-finimp.ads, s-finimp.adb (Move_Final_List): New procedure to move
a return statement's finalization list to the caller's list, used for
build-in-place functions with result type with controlled parts.
Remove no longer used entities.
* s-taskin.ads (Activation_Chain): Remove pragma Volatile. It is no
longer needed, because the full type is now limited, and therefore a
pass-by-reference type.
(Foreign_Task_Level): New constant.
* s-tassta.ads, s-tassta.adb (Move_Activation_Chain): New procedure to
move tasks from the activation chain belonging to a return statement to
the one passed in by the caller, and update the master to the one
passed in by the caller.
(Vulnerable_Complete_Master, Check_Unactivated_Tasks): Check the master
of unactivated tasks, so we don't kill the ones that are being returned
by a build-in-place function.
(Create_Task): Ignore AI-280 for foreign threads.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123558 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch6.ads')
-rw-r--r-- | gcc/ada/sem_ch6.ads | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/gcc/ada/sem_ch6.ads b/gcc/ada/sem_ch6.ads index 52b657080bc..f465c80debf 100644 --- a/gcc/ada/sem_ch6.ads +++ b/gcc/ada/sem_ch6.ads @@ -27,6 +27,12 @@ with Types; use Types; package Sem_Ch6 is + type Conformance_Type is + (Type_Conformant, Mode_Conformant, Subtype_Conformant, Fully_Conformant); + -- Conformance type used in conformance checks between specs and bodies, + -- and for overriding. The literals match the RM definitions of the + -- corresponding terms. + procedure Analyze_Abstract_Subprogram_Declaration (N : Node_Id); procedure Analyze_Extended_Return_Statement (N : Node_Id); procedure Analyze_Function_Call (N : Node_Id); @@ -39,7 +45,8 @@ package Sem_Ch6 is function Analyze_Subprogram_Specification (N : Node_Id) return Entity_Id; -- Analyze subprogram specification in both subprogram declarations - -- and body declarations. Returns the defining entity for the spec. + -- and body declarations. Returns the defining entity for the + -- specification N. procedure Cannot_Inline (Msg : String; N : Node_Id; Subp : Entity_Id); -- This procedure is called if the node N, an instance of a call to @@ -55,9 +62,9 @@ package Sem_Ch6 is -- their respective counterparts. procedure Check_Delayed_Subprogram (Designator : Entity_Id); - -- Designator can be a E_Subrpgram_Type, E_Procedure or E_Function. If a + -- Designator can be a E_Subprogram_Type, E_Procedure or E_Function. If a -- type in its profile depends on a private type without a full - -- declaration, indicate that the subprogram is delayed. + -- declaration, indicate that the subprogram or type is delayed. procedure Check_Discriminant_Conformance (N : Node_Id; @@ -112,6 +119,16 @@ package Sem_Ch6 is -- the flag being placed on the Err_Loc node if it is specified, and -- on the appropriate component of the New_Id construct if not. + function Conforming_Types + (T1 : Entity_Id; + T2 : Entity_Id; + Ctype : Conformance_Type; + Get_Inst : Boolean := False) return Boolean; + -- Check that the types of two formal parameters are conforming. In most + -- cases this is just a name comparison, but within an instance it involves + -- generic actual types, and in the presence of anonymous access types + -- it must examine the designated types. + procedure Create_Extra_Formals (E : Entity_Id); -- For each parameter of a subprogram or entry that requires an additional -- formal (such as for access parameters and indefinite discriminated |