aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-03-08 17:37:29 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-16 08:42:03 +0000
commit90fadb50df34d11348ec67a1cbbaeac8a28c2da3 (patch)
tree98577a4ab5e09d8ff0dd327501e31fb85f4488fd
parentd12b8e951c3c13e24b41f4c59157aa0643fd1d44 (diff)
downloadgcc-90fadb50df34d11348ec67a1cbbaeac8a28c2da3.zip
gcc-90fadb50df34d11348ec67a1cbbaeac8a28c2da3.tar.gz
gcc-90fadb50df34d11348ec67a1cbbaeac8a28c2da3.tar.bz2
[Ada] Improve building of untagged equality
When checking components of a record type for their own user-defined equality function it is enough to find just one such a component. Cleanup related to handling of user-defined equality in GNATprove. gcc/ada/ * exp_ch3.adb (Build_Untagged_Equality): Exit early when the outcome of a loop is already known.
-rw-r--r--gcc/ada/exp_ch3.adb1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 018f88b..dfbbc62 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -4541,6 +4541,7 @@ package body Exp_Ch3 is
and then Present (User_Defined_Eq (Etype (Comp)))
then
Build_Eq := True;
+ exit;
end if;
Next_Component (Comp);