https://gcc.gnu.org/g:06078187797f077f0548c55ac8cb8eca4094f1c3
commit r15-541-g06078187797f077f0548c55ac8cb8eca4094f1c3 Author: Piotr Trojanek <troja...@adacore.com> Date: Wed Feb 14 18:24:03 2024 +0100 ada: Reuse existing expression when rewriting aspects to pragmas Code cleanup; semantics is unaffected. gcc/ada/ * sem_ch13.adb (Analyze_Aspect_Specification): Consistently reuse existing constant where possible. Diff: --- gcc/ada/sem_ch13.adb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index ce9f15c1491a..00392ae88ebe 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -1838,7 +1838,7 @@ package body Sem_Ch13 is Make_Pragma_Argument_Association (Loc, Expression => Conv), Make_Pragma_Argument_Association (Loc, - Expression => New_Occurrence_Of (E, Loc)))); + Expression => Ent))); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); @@ -3099,7 +3099,7 @@ package body Sem_Ch13 is Aitem := Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, - Expression => New_Occurrence_Of (E, Loc)), + Expression => Ent), Make_Pragma_Argument_Association (Sloc (Expr), Expression => Relocate_Node (Expr))), Pragma_Name => Name_Linker_Section); @@ -3120,7 +3120,7 @@ package body Sem_Ch13 is Aitem := Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, - Expression => New_Occurrence_Of (E, Loc)), + Expression => Ent), Make_Pragma_Argument_Association (Sloc (Expr), Expression => Relocate_Node (Expr))), Pragma_Name => Name_Implemented); @@ -3439,7 +3439,7 @@ package body Sem_Ch13 is Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr)), Make_Pragma_Argument_Association (Sloc (Expr), - Expression => New_Occurrence_Of (E, Loc))), + Expression => Ent)), Pragma_Name => Nam); Delay_Required := False; @@ -3452,7 +3452,7 @@ package body Sem_Ch13 is Make_Pragma_Argument_Association (Sloc (Expr), Expression => Relocate_Node (Expr)), Make_Pragma_Argument_Association (Loc, - Expression => New_Occurrence_Of (E, Loc))), + Expression => Ent)), Pragma_Name => Name_Warnings); Decorate (Aspect, Aitem);