+2017-01-19 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the
+ representation-to-position function as inlined.
+ * sem_cat.adb (Set_Categorization_From_Scope): Do not modify
+ the purity of an internally generated entity if it has been
+ explicitly marked as pure for optimization purposes.
+ * exp_aggr.adb: Minor reformatting.
+
2017-01-19 Javier Miranda <miranda@adacore.com>
* exp_ch6.adb (Expand_Call): Remove side effects on
elsif Is_Derived_Type (Typ) then
- -- For untagged types, non-stored discriminants are replaced
- -- with stored discriminants, which are the ones that gigi uses
- -- to describe the type and its components.
+ -- For untagged types, non-stored discriminants are replaced with
+ -- stored discriminants, which are the ones that gigi uses to
+ -- describe the type and its components.
Generate_Aggregate_For_Derived_Type : declare
Constraints : constant List_Id := New_List;
while Present (Discriminant) loop
New_Comp :=
Make_Component_Association (Loc,
- Choices =>
- New_List (New_Occurrence_Of (Discriminant, Loc)),
-
+ Choices => New_List (
+ New_Occurrence_Of (Discriminant, Loc)),
Expression =>
New_Copy_Tree
(Get_Discriminant_Value
(Discriminant,
Typ,
Discriminant_Constraint (Typ)));
+
Append (New_Comp, Constraints);
Next_Stored_Discriminant (Discriminant);
end loop;
-- all the inherited components.
if Is_Derived_Type (Typ) then
-
declare
First_Comp : Node_Id;
Parent_Comps : List_Id;
elsif Tagged_Type_Expansion then
declare
Tag_Name : constant Node_Id :=
- New_Occurrence_Of (First_Tag_Component (Typ), Loc);
+ New_Occurrence_Of
+ (First_Tag_Component (Typ), Loc);
Typ_Tag : constant Entity_Id := RTE (RE_Tag);
Conv_Node : constant Node_Id :=
- Unchecked_Convert_To (Typ_Tag, Tag_Value);
+ Unchecked_Convert_To (Typ_Tag, Tag_Value);
begin
Set_Etype (Conv_Node, Typ_Tag);
begin
Aggr := N;
while Present (Parent (Aggr))
- and then Nkind_In (Parent (Aggr), N_Component_Association,
- N_Aggregate)
+ and then Nkind_In (Parent (Aggr), N_Aggregate,
+ N_Component_Association)
loop
Aggr := Parent (Aggr);
end loop;
-- aggregates for C++ imported types must be expanded.
if Ada_Version >= Ada_2005 and then Is_Limited_View (Typ) then
- if not Nkind_In (Parent (N), N_Object_Declaration,
- N_Component_Association)
+ if not Nkind_In (Parent (N), N_Component_Association,
+ N_Object_Declaration)
then
Convert_To_Assignments (N, Typ);
Specification : Node_Id := Empty;
begin
- Set_Is_Pure
- (E, Is_Pure (Scop) and then Is_Library_Level_Entity (E));
+ -- Do not modify the purity of an internally generated entity if it has
+ -- been explicitly marked as pure for optimization purposes.
+
+ if not Has_Pragma_Pure_Function (E) then
+ Set_Is_Pure
+ (E, Is_Pure (Scop) and then Is_Library_Level_Entity (E));
+ end if;
if not Is_Remote_Call_Interface (E) then
if Ekind (E) in Subprogram_Kind then