aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-05-27 17:16:34 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2021-07-08 13:34:20 +0000
commit73f841cfca82827a60b9a4da8400f6686c85d3ec (patch)
tree58d166c1371b2ae245561ae23cc9c2720d360ff9 /gcc
parente959418a07c3753877aac9a3194d740c38e7058b (diff)
downloadgcc-73f841cfca82827a60b9a4da8400f6686c85d3ec.zip
gcc-73f841cfca82827a60b9a4da8400f6686c85d3ec.tar.gz
gcc-73f841cfca82827a60b9a4da8400f6686c85d3ec.tar.bz2
[Ada] Simplify redundant checks for non-empty lists
gcc/ada/ * sem_ch12.adb, sem_ch6.adb, sem_ch9.adb, sprint.adb: Simplify checks for non-empty lists.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch12.adb1
-rw-r--r--gcc/ada/sem_ch6.adb1
-rw-r--r--gcc/ada/sem_ch9.adb4
-rw-r--r--gcc/ada/sprint.adb8
4 files changed, 3 insertions, 11 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index bf51ce9..85c854f 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -9724,7 +9724,6 @@ package body Sem_Ch12 is
if Nkind (Par_N) = N_Package_Specification
and then Decls = Visible_Declarations (Par_N)
- and then Present (Private_Declarations (Par_N))
and then not Is_Empty_List (Private_Declarations (Par_N))
then
Decls := Private_Declarations (Par_N);
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 75e5a99..fbb2b55 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -549,7 +549,6 @@ package body Sem_Ch6 is
else
if Nkind (Par) = N_Package_Specification
and then Decls = Visible_Declarations (Par)
- and then Present (Private_Declarations (Par))
and then not Is_Empty_List (Private_Declarations (Par))
then
Decls := Private_Declarations (Par);
diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb
index 65f48a7..ab25dd0 100644
--- a/gcc/ada/sem_ch9.adb
+++ b/gcc/ada/sem_ch9.adb
@@ -1955,9 +1955,7 @@ package body Sem_Ch9 is
Tasking_Used := True;
Analyze_Declarations (Visible_Declarations (N));
- if Present (Private_Declarations (N))
- and then not Is_Empty_List (Private_Declarations (N))
- then
+ if not Is_Empty_List (Private_Declarations (N)) then
Last_Id := Last_Entity (Prot_Typ);
Analyze_Declarations (Private_Declarations (N));
diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb
index 4467929..c1f1ede 100644
--- a/gcc/ada/sprint.adb
+++ b/gcc/ada/sprint.adb
@@ -1065,16 +1065,12 @@ package body Sprint is
if Present (Expressions (Node)) then
Sprint_Comma_List (Expressions (Node));
- if Present (Component_Associations (Node))
- and then not Is_Empty_List (Component_Associations (Node))
- then
+ if not Is_Empty_List (Component_Associations (Node)) then
Write_Str (", ");
end if;
end if;
- if Present (Component_Associations (Node))
- and then not Is_Empty_List (Component_Associations (Node))
- then
+ if not Is_Empty_List (Component_Associations (Node)) then
Indent_Begin;
declare