]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Remove excessive guards in building predicate functions
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 9 Jul 2020 20:16:46 +0000 (22:16 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 19 Oct 2020 09:53:40 +0000 (05:53 -0400)
gcc/ada/

* sem_ch13.adb (Add_Call): Remove excessive condition and
unnecessary call to Set_Has_Predicates.

gcc/ada/sem_ch13.adb

index b40c575695f7adc139405cf6c71ad4fd9078e5ad..8f02d07acb782d15758e9d18edb75ff38769eb78 100644 (file)
@@ -9583,8 +9583,8 @@ package body Sem_Ch13 is
       --  Predicate_Function of the parent type, using Add_Call above.
 
       procedure Add_Call (T : Entity_Id);
-      --  Includes a call to the predicate function for type T in Expr if T
-      --  has predicates and Predicate_Function (T) is non-empty.
+      --  Includes a call to the predicate function for type T in Expr if
+      --  Predicate_Function (T) is non-empty.
 
       function Process_RE (N : Node_Id) return Traverse_Result;
       --  Used in Process REs, tests if node N is a raise expression, and if
@@ -9608,8 +9608,8 @@ package body Sem_Ch13 is
          Exp : Node_Id;
 
       begin
-         if Present (T) and then Present (Predicate_Function (T)) then
-            Set_Has_Predicates (Typ);
+         if Present (Predicate_Function (T)) then
+            pragma Assert (Has_Predicates (Typ));
 
             --  Build the call to the predicate function of T. The type may be
             --  derived, so use an unchecked conversion for the actual.