aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2024-02-14 18:24:03 +0100
committerMarc Poulhiès <poulhies@adacore.com>2024-05-16 10:49:26 +0200
commit06078187797f077f0548c55ac8cb8eca4094f1c3 (patch)
tree174564d4f0e3b7ac49fc674426a54b65079c04e8
parent492f896e3a224a09c5f693249dc302dda435fae7 (diff)
downloadgcc-06078187797f077f0548c55ac8cb8eca4094f1c3.zip
gcc-06078187797f077f0548c55ac8cb8eca4094f1c3.tar.gz
gcc-06078187797f077f0548c55ac8cb8eca4094f1c3.tar.bz2
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.
-rw-r--r--gcc/ada/sem_ch13.adb10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index ce9f15c..00392ae 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);