]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Rename Within_Case_Or_If_Expression predicate
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 10 Nov 2024 09:46:54 +0000 (10:46 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 19 Nov 2024 12:58:50 +0000 (13:58 +0100)
The case and if expressions are exactly the conditional expressions.

gcc/ada/ChangeLog:

* exp_util.ads (Within_Case_Or_If_Expression): Rename into...
(Within_Conditional_Expression): ...this.
* exp_util.adb (Within_Case_Or_If_Expression): Rename into...
(Within_Conditional_Expression): ...this.
* checks.adb (Install_Null_Excluding_Check): Adjust for renaming.

gcc/ada/checks.adb
gcc/ada/exp_util.adb
gcc/ada/exp_util.ads

index 8a3c4e8b4bfb4606a18b43b1352f34391aac02ae..1ec49924c9be9c0ed0fe475283342433c6c90d00 100644 (file)
@@ -8427,7 +8427,7 @@ package body Checks is
            --  where the expression might not be evaluated, and the warning
            --  appear as extraneous noise.
 
-           and then not Within_Case_Or_If_Expression (N)
+           and then not Within_Conditional_Expression (N)
          then
             Apply_Compile_Time_Constraint_Error
               (N, "null value not allowed here??", CE_Access_Check_Failed);
index e4397fe868d7ea08ebb323de3b64610622343c65..149be620b1b42cf248ad1c2725c56aa9b233da15 100644 (file)
@@ -6702,7 +6702,7 @@ package body Exp_Util is
       --  then we need to insert at the appropriate (inner) location in
       --  the not as an action on Node_To_Be_Wrapped.
 
-      In_Cond_Expr : constant Boolean := Within_Case_Or_If_Expression (N);
+      In_Cond_Expr : constant Boolean := Within_Conditional_Expression (N);
 
    begin
       --  When the node is inside a case/if expression, the lifetime of any
@@ -14632,11 +14632,11 @@ package body Exp_Util is
       Map_Types (Parent_Type, Derived_Type);
    end Update_Primitives_Mapping;
 
-   ----------------------------------
-   -- Within_Case_Or_If_Expression --
-   ----------------------------------
+   -----------------------------------
+   -- Within_Conditional_Expression --
+   -----------------------------------
 
-   function Within_Case_Or_If_Expression (N : Node_Id) return Boolean is
+   function Within_Conditional_Expression (N : Node_Id) return Boolean is
       Nod : Node_Id;
       Par : Node_Id;
 
@@ -14680,7 +14680,7 @@ package body Exp_Util is
       end loop;
 
       return False;
-   end Within_Case_Or_If_Expression;
+   end Within_Conditional_Expression;
 
    ------------------------------
    -- Predicate_Check_In_Scope --
index 0872db21491163b73dba9f32c8cd01862949815c..751fb5b31e0875283d2143a6e24028ed054905e7 100644 (file)
@@ -1283,11 +1283,11 @@ package Exp_Util is
    --  when elaborating a contract for a subprogram, and when freezing a type
    --  extension to verify legality rules on inherited conditions.
 
-   function Within_Case_Or_If_Expression (N : Node_Id) return Boolean;
+   function Within_Conditional_Expression (N : Node_Id) return Boolean;
    --  Determine whether arbitrary node N is immediately within a dependent
-   --  expression of a case or an if expression. The criterion is whether
+   --  expression of a conditional expression. The criterion is whether
    --  temporaries created by the actions attached to N need to outlive an
-   --  enclosing case or if expression.
+   --  enclosing conditional expression.
 
 private
    pragma Inline (Duplicate_Subexpr);