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/s-taskin.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/s-taskin.ads')
-rw-r--r-- | gcc/ada/s-taskin.ads | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ada/s-taskin.ads b/gcc/ada/s-taskin.ads index a9b1812b7dc..ae6908dac49 100644 --- a/gcc/ada/s-taskin.ads +++ b/gcc/ada/s-taskin.ads @@ -364,10 +364,12 @@ package System.Tasking is ------------------------------------ type Activation_Chain is limited private; - -- Comment required ??? + -- Linked list of to-be-activated tasks, linked through + -- Activation_Link. The order of tasks on the list is irrelevant, because + -- the priority rules will ensure that they actually start activating in + -- priority order. type Activation_Chain_Access is access all Activation_Chain; - -- Comment required ??? type Task_Procedure_Access is access procedure (Arg : System.Address); @@ -651,11 +653,14 @@ package System.Tasking is -- Normally, a task starts out with internal master nesting level one -- larger than external master nesting level. It is incremented to one by -- Enter_Master, which is called in the task body only if the compiler - -- thinks the task may have dependent tasks. It is set to for the + -- thinks the task may have dependent tasks. It is set to 1 for the -- environment task, the level 2 is reserved for server tasks of the -- run-time system (the so called "independent tasks"), and the level 3 is - -- for the library level tasks. + -- for the library level tasks. Foreign threads which are detected by + -- the run-time have a level of 0, allowing these tasks to be easily + -- distinguished if needed. + Foreign_Task_Level : constant Master_Level := 0; Environment_Task_Level : constant Master_Level := 1; Independent_Task_Level : constant Master_Level := 2; Library_Task_Level : constant Master_Level := 3; @@ -1062,14 +1067,14 @@ package System.Tasking is private Null_Task : constant Task_Id := null; - type Activation_Chain is record + type Activation_Chain is limited record T_ID : Task_Id; end record; - pragma Volatile (Activation_Chain); - -- Activation_chain is an in-out parameter of initialization procedures - -- and it must be passed by reference because the init proc may terminate + -- Activation_Chain is an in-out parameter of initialization procedures and + -- it must be passed by reference because the init proc may terminate -- abnormally after creating task components, and these must be properly - -- registered for removal (Expunge_Unactivated_Tasks). + -- registered for removal (Expunge_Unactivated_Tasks). The "limited" forces + -- Activation_Chain to be a by-reference type; see RM-6.2(4). end System.Tasking; |