aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-02-16 10:00:02 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-12 12:38:41 +0000
commite28064111c3c42e7b75c79c941c9fc339901f0dd (patch)
tree59148f94c64666c6b4fad097312570faf09c367e /gcc/ada/sem_res.adb
parent0c1ec8ae18b57131f62c31e0144dd0d8aa3a92eb (diff)
downloadgcc-e28064111c3c42e7b75c79c941c9fc339901f0dd.zip
gcc-e28064111c3c42e7b75c79c941c9fc339901f0dd.tar.gz
gcc-e28064111c3c42e7b75c79c941c9fc339901f0dd.tar.bz2
[Ada] Reuse collective subtype for comparison operators where possible
Replace membership alternatives with N_Op_Compare. Code cleanup; semantics is unaffected. gcc/ada/ * sem_res.adb (Resolve_Actuals): Simplify with N_Op_Compare. * sem_util.adb (Replace_Null_Operand, Null_To_Null_Address_Convert_OK): Likewise.
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb7
1 files changed, 1 insertions, 6 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 125366b..f038a33 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -4163,12 +4163,7 @@ package body Sem_Res is
-- marked with Any_Type. Since the operation has been resolved to
-- the user-defined operator, that is irrelevant, so reset Etype.
- if Nkind (Original_Node (N)) in N_Op_Eq
- | N_Op_Ge
- | N_Op_Gt
- | N_Op_Le
- | N_Op_Lt
- | N_Op_Ne
+ if Nkind (Original_Node (N)) in N_Op_Compare
and then not Is_Boolean_Type (Etype (N))
then
Set_Etype (A, Etype (F));