Append (Init_Stat, Aggr_Code);
-- The container will grow dynamically. Create a declaration for
- -- the object, and initialize it either from a call to the Empty
- -- function, or from the Empty constant.
+ -- the object, and initialize it from a call to the parameterless
+ -- Empty function.
else
+ pragma Assert (Ekind (Entity (Empty_Subp)) = E_Function);
+
Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Insert_Action (N, Decl);
- -- The Empty entity is either a parameterless function, or
- -- a constant.
-
- if Ekind (Entity (Empty_Subp)) = E_Function then
- Init_Stat := Make_Assignment_Statement (Loc,
- Name => New_Occurrence_Of (Temp, Loc),
- Expression => Make_Function_Call (Loc,
- Name => New_Occurrence_Of (Entity (Empty_Subp), Loc)));
+ -- The Empty entity is a parameterless function
- else
- Init_Stat := Make_Assignment_Statement (Loc,
- Name => New_Occurrence_Of (Temp, Loc),
- Expression => New_Occurrence_Of (Entity (Empty_Subp), Loc));
- end if;
+ Init_Stat := Make_Assignment_Statement (Loc,
+ Name => New_Occurrence_Of (Temp, Loc),
+ Expression => Make_Function_Call (Loc,
+ Name => New_Occurrence_Of (Entity (Empty_Subp), Loc)));
Append (Init_Stat, Aggr_Code);
end if;
Variable_Indexing => Reference,
Default_Iterator => Iterate,
Iterator_Element => Element_Type,
- Aggregate => (Empty => Empty_Vector,
+ Aggregate => (Empty => Empty,
Add_Unnamed => Append,
New_Indexed => New_Vector,
Assign_Indexed => Replace_Element);
if Etype (E) /= Typ or else Scope (E) /= Scope (Typ) then
return False;
- elsif Ekind (E) = E_Constant then
- return True;
-
elsif Ekind (E) = E_Function then
return No (First_Formal (E))
or else
- (Is_Integer_Type (Etype (First_Formal (E)))
+ (Is_Signed_Integer_Type (Etype (First_Formal (E)))
and then No (Next_Formal (First_Formal (E))));
else
return False;