aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch3.adb
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2024-08-08 17:06:09 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-09-02 10:22:49 +0200
commit905ab329ccd06b0154eb42724eb5999165cd01fc (patch)
treec85ff572c58d1c7f1d787db4805cb0ff7a45775d /gcc/ada/exp_ch3.adb
parent78acc6d85f972102b92e803bef0aac0afdb1ca9e (diff)
downloadgcc-905ab329ccd06b0154eb42724eb5999165cd01fc.zip
gcc-905ab329ccd06b0154eb42724eb5999165cd01fc.tar.gz
gcc-905ab329ccd06b0154eb42724eb5999165cd01fc.tar.bz2
ada: Cleanup expansion of object declarations
Replace repeated calls to Sloc with uses of local constant Loc. Code cleanup; behavior is unaffected. gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declaration): Replace calls to Sloc with uses of Loc; turn variable Prag into constant.
Diffstat (limited to 'gcc/ada/exp_ch3.adb')
-rw-r--r--gcc/ada/exp_ch3.adb10
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 4f6fa4c..ff808aa 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -7658,11 +7658,9 @@ package body Exp_Ch3 is
and then Is_Library_Level_Entity (Def_Id)
then
declare
- Prag : Node_Id;
+ Prag : constant Node_Id :=
+ Make_Linker_Section_Pragma (Def_Id, Loc, ".persistent.bss");
begin
- Prag :=
- Make_Linker_Section_Pragma
- (Def_Id, Sloc (N), ".persistent.bss");
Insert_After (N, Prag);
Analyze (Prag);
end;
@@ -8349,10 +8347,8 @@ package body Exp_Ch3 is
-- An Ada 2012 stand-alone object of an anonymous access type
declare
- Loc : constant Source_Ptr := Sloc (N);
-
Level : constant Entity_Id :=
- Make_Defining_Identifier (Sloc (N),
+ Make_Defining_Identifier (Loc,
Chars =>
New_External_Name (Chars (Def_Id), Suffix => "L"));