Routine Move_Aspects does nothing if its From parameter has no aspects.
There is no need to check this at the call sites.
Code cleanup related to changes in handling of expressions functions in
GNATprove; semantics is unaffected.
gcc/ada/
* par-ch7.adb (P_Package): Remove redundant guard from call to
Move_Aspects.
* par-ch9.adb (P_Task): Likewise.
* sem_ch6.adb (Analyze_Expression_Function, Is_Inline_Pragma): Likewise.
-- Move the aspect specifications to the body node
- if Has_Aspects (Dummy_Node) then
- Move_Aspects (From => Dummy_Node, To => Package_Node);
- end if;
+ Move_Aspects (From => Dummy_Node, To => Package_Node);
Parse_Decls_Begin_End (Package_Node);
end if;
-- Move the aspect specifications to the body node
- if Has_Aspects (Dummy_Node) then
- Move_Aspects (From => Dummy_Node, To => Task_Node);
- end if;
+ Move_Aspects (From => Dummy_Node, To => Task_Node);
Parse_Decls_Begin_End (Task_Node);
-- function to the proper body when the expression function acts
-- as a completion.
- if Has_Aspects (N) then
- Move_Aspects (N, To => New_Body);
- end if;
+ Move_Aspects (N, To => New_Body);
Relocate_Pragmas_To_Body (New_Body);
-- Move aspects to the new spec
- if Has_Aspects (N) then
- Move_Aspects (N, To => Decl);
- end if;
+ Move_Aspects (N, To => Decl);
Insert_Before (N, Decl);
Analyze (Decl);