Null_Record_Present => True);
-- GNATprove will use expression of an expression function as an
- -- implicit postcondition.
+ -- implicit postcondition. GNAT will also benefit from expression
+ -- function to avoid premature freezing, but would struggle if we
+ -- added an expression function to freezing actions, so we create
+ -- the expanded form directly.
if GNATprove_Mode then
Func_Body :=
Statements => New_List (
Make_Simple_Return_Statement (Loc,
Expression => Ext_Aggr))));
+ Set_Was_Expression_Function (Func_Body);
end if;
Append_To (Body_List, Func_Body);
if Is_Expression_Function (Node (Elmt)) then
Expr := New_Occurrence_Of (Node (Elmt), Sloc (N));
Set_Comes_From_Source (Expr);
- Set_Entity (Expr, Node (Elmt));
Set_Parent (Expr, N);
Freeze_Expression (Expr);
else
Set_Has_Delayed_Freeze (Spec_Id);
Create_Extra_Formals (Spec_Id, Related_Nod => N);
Freeze_Before (N, Spec_Id,
- Do_Freeze_Profile => not Is_Dispatching_Operation (Spec_Id));
+ Do_Freeze_Profile => not
+ (From_Expression_Function
+ and then Is_Dispatching_Operation (Spec_Id)));
end if;
end if;