| Aspect_Iterator_Element
| Aspect_Max_Entry_Queue_Length
| Aspect_No_Controlled_Parts
+ | Aspect_No_Task_Parts
| Aspect_Real_Literal
| Aspect_String_Literal
| Aspect_Variable_Indexing;
Check_Expr_Is_OK_Static_Expression (Expr, Any_Boolean);
end if;
+ -- Record the No_Task_Parts aspects as a rep item so it
+ -- can be consistently looked up on the full view of the
+ -- type.
+
+ if Is_Private_Type (E) then
+ Record_Rep_Item (E, Aspect);
+ end if;
+
goto Continue;
-- Ada 2022 (AI12-0075): static expression functions
function Might_Need_BIP_Task_Actuals (E : Entity_Id) return Boolean is
Subp_Id : Entity_Id;
- Func_Typ : Entity_Id;
+ Original : Entity_Id;
+ Root : Entity_Id;
+
+ function Has_No_Task_Parts_Enabled (E : Entity_Id) return Boolean
+ is (Has_Enabled_Aspect (E, Aspect_No_Task_Parts));
+
+ function Collect_Ancestors_With_No_Task_Parts is new
+ Collect_Types_In_Hierarchy (Predicate => Has_No_Task_Parts_Enabled);
+
+ -- Start of processing for Might_Need_BIP_Task_Actuals
begin
if Global_No_Tasking or else No_Run_Time_Mode then
then
Subp_Id := Protected_Body_Subprogram (E);
- else
+ -- For access to subprogram types we look at the return type of the
+ -- subprogram type itself, as it cannot be overridden or inherited.
+
+ elsif Ekind (E) = E_Subprogram_Type then
Subp_Id := E;
- end if;
- -- We check the root type of the return type since the same
- -- decision must be taken for all descendants overriding a
- -- dispatching operation.
+ -- Otherwise, we need to return the same value we would return for
+ -- the original corresponding operation.
+
+ else
+ Subp_Id := Original_Corresponding_Operation (E);
+ end if;
- Func_Typ := Root_Type (Underlying_Type (Etype (Subp_Id)));
+ Original := Underlying_Type (Etype (Subp_Id));
+ Root := Underlying_Type (Root_Type (Original));
return Ekind (Subp_Id) in E_Function | E_Subprogram_Type
- and then not Has_Foreign_Convention (Func_Typ)
- and then Is_Tagged_Type (Func_Typ)
- and then Is_Limited_Type (Func_Typ)
- and then not Has_Aspect (Func_Typ, Aspect_No_Task_Parts);
+ and then Is_Inherently_Limited_Type (Original)
+ and then not Has_Foreign_Convention (Root)
+ and then Is_Tagged_Type (Root)
+ and then Is_Empty_Elmt_List
+ (Collect_Ancestors_With_No_Task_Parts (Original));
end Might_Need_BIP_Task_Actuals;
-------------------------------------
Formal : Entity_Id;
Ctrl_Type : Entity_Id;
+ -- Start of processing for Find_Dispatching_Type
+
begin
if Ekind (Subp) in E_Function | E_Procedure
and then Present (DTC_Entity (Subp))
Aspect_Aggregate,
Aspect_Max_Entry_Queue_Length
-- , Aspect_No_Controlled_Parts
+ -- , Aspect_No_Task_Parts
);
-- Note that none of these 8 aspects can be specified (for a type)
| Aspect_Iterator_Element
| Aspect_Max_Entry_Queue_Length
| Aspect_No_Controlled_Parts
+ | Aspect_No_Task_Parts
=>
return;
end case;
Names_Match (Assign_Indexed_1, Assign_Indexed_2);
end;
- -- Checking for this aspect is performed elsewhere during freezing
- when Aspect_No_Controlled_Parts =>
+ -- Checking for these aspects is performed elsewhere during freezing
+ when Aspect_No_Controlled_Parts
+ | Aspect_No_Task_Parts =>
return True;
-- scalar-valued aspects; compare (static) values.
-- object as per RM C.6(8).
function Is_Inherited_Operation (E : Entity_Id) return Boolean;
- -- E is a subprogram. Return True is E is an implicit operation inherited
+ -- E is a subprogram. Return True if E is an implicit operation inherited
-- by a derived type declaration.
function Is_Inlinable_Expression_Function (Subp : Entity_Id) return Boolean;
-- the encapsulated expression is nontrivial.
function Is_Null_Extension
- (T : Entity_Id; Ignore_Privacy : Boolean := False) return Boolean;
+ (T : Entity_Id; Ignore_Privacy : Boolean := False) return Boolean;
-- Given a tagged type, returns True if argument is a type extension
-- that introduces no new components (discriminant or nondiscriminant).
-- Ignore_Privacy should be True for use in implementing dynamic semantics.