aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-11-05 11:35:26 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2020-11-27 04:16:03 -0500
commit586f6dd1f62c0aec857cdb6d52993a28838fc11a (patch)
treeee11af0cbe959f83227436278735017fa6d51da1 /gcc
parent4a3b4c2a453369f7c72b0b3be8567134533c01bb (diff)
downloadgcc-586f6dd1f62c0aec857cdb6d52993a28838fc11a.zip
gcc-586f6dd1f62c0aec857cdb6d52993a28838fc11a.tar.gz
gcc-586f6dd1f62c0aec857cdb6d52993a28838fc11a.tar.bz2
[Ada] Reuse Append_New_Elmt where possible
gcc/ada/ * cstand.adb: Simplify with Append_New_Elmt. * sem_util.adb: Likewise.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/cstand.adb6
-rw-r--r--gcc/ada/sem_util.adb12
2 files changed, 3 insertions, 15 deletions
diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb
index 36634c7..3f5389c 100644
--- a/gcc/ada/cstand.adb
+++ b/gcc/ada/cstand.adb
@@ -2074,11 +2074,7 @@ package body CStand is
Build_Float_Type
(Ent, Pos (Digs), Float_Rep, Int (Size), Int (Alignment / 8));
- if No (Back_End_Float_Types) then
- Back_End_Float_Types := New_Elmt_List;
- end if;
-
- Append_Elmt (Ent, Back_End_Float_Types);
+ Append_New_Elmt (Ent, Back_End_Float_Types);
end Register_Float_Type;
----------------------
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 958e55a..675aeed 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -6454,11 +6454,7 @@ package body Sem_Util is
and then Etype (First_Formal (Id)) =
Etype (Next_Formal (First_Formal (Id)))
then
- if No (Eq_Prims_List) then
- Eq_Prims_List := New_Elmt_List;
- end if;
-
- Append_Elmt (Id, Eq_Prims_List);
+ Append_New_Elmt (Id, Eq_Prims_List);
end if;
end if;
end if;
@@ -22455,11 +22451,7 @@ package body Sem_Util is
function Search_Decl (N : Node_Id) return Traverse_Result is
begin
if Nkind (N) in N_Declaration then
- if No (Decls) then
- Decls := New_Elmt_List;
- end if;
-
- Append_Elmt (N, Decls);
+ Append_New_Elmt (N, Decls);
end if;
return OK;