end return;
end Base_Type_If_Set;
+ function Can_Have_Formals (Id : Entity_Id) return Boolean
+ is (Is_Generic_Subprogram (Id)
+ or else Is_Overloadable (Id)
+ or else Ekind (Id)
+ in E_Entry_Family | E_Subprogram_Body | E_Subprogram_Type);
+
----------------------
-- Declaration_Node --
----------------------
Formal : Entity_Id;
begin
- pragma Assert
- (Is_Generic_Subprogram (Id)
- or else Is_Overloadable (Id)
- or else Ekind (Id) in E_Entry_Family
- | E_Subprogram_Body
- | E_Subprogram_Type);
+ pragma Assert (Can_Have_Formals (Id));
if Ekind (Id) = E_Enumeration_Literal then
return Empty;
Formal : Entity_Id;
begin
- pragma Assert
- (Is_Generic_Subprogram (Id)
- or else Is_Overloadable (Id)
- or else Ekind (Id) in E_Entry_Family
- | E_Subprogram_Body
- | E_Subprogram_Type);
+ pragma Assert (Can_Have_Formals (Id));
if Ekind (Id) = E_Enumeration_Literal then
return Empty;
Formal : Entity_Id;
begin
- pragma Assert
- (Is_Overloadable (Id)
- or else Ekind (Id) in E_Entry_Family
- | E_Subprogram_Body
- | E_Subprogram_Type);
+ pragma Assert (Can_Have_Formals (Id));
if Ekind (Id) = E_Enumeration_Literal then
return Empty;
-- Call [Set_]Is_Volatile_Type/Is_Volatile_Object as appropriate for the
-- Ekind of Id.
+ function Can_Have_Formals (Id : Entity_Id) return Boolean;
+ -- A utility function to see whether the entity can have formals.
+
function Convention
(N : Entity_Id) return Convention_Id renames Basic_Convention;
procedure Set_Convention (E : Entity_Id; Val : Convention_Id);
-- we are not dealing with an expanded construct.
if Present (Id)
+ and then Can_Have_Formals (Id)
and then Comes_From_Source (N)
and then Ghost_Config.Ghost_Mode /= None
then
Orig_Actual := First_Actual (N);
Formal := First_Formal (Id);
- while Present (Orig_Actual) loop
+ while Present (Orig_Actual) and then Present (Formal) loop
-- Similarly to Mark_And_Set_Ghost_Procedure_Call we need to
-- analyze the call argument first to get its level for this
-- analysis.