diff options
-rw-r--r-- | gcc/ada/sem_util.adb | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 1166c68..b5c3363 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -19582,39 +19582,14 @@ package body Sem_Util is -- Local variables - Par : Node_Id; Expr : Node_Id; + Par : Node_Id; -- Start of processing for Is_Potentially_Unevaluated begin Expr := N; - Par := N; - - -- A postcondition whose expression is a short-circuit is broken down - -- into individual aspects for better exception reporting. The original - -- short-circuit expression is rewritten as the second operand, and an - -- occurrence of 'Old in that operand is potentially unevaluated. - -- See sem_ch13.adb for details of this transformation. The reference - -- to 'Old may appear within an expression, so we must look for the - -- enclosing pragma argument in the tree that contains the reference. - - while Present (Par) - and then Nkind (Par) /= N_Pragma_Argument_Association - loop - if Is_Rewrite_Substitution (Par) - and then Nkind (Original_Node (Par)) = N_And_Then - then - return True; - end if; - - Par := Parent (Par); - end loop; - - -- Other cases; 'Old appears within other expression (not the top-level - -- conjunct in a postcondition) with a potentially unevaluated operand. - - Par := Parent (Expr); + Par := Parent (Expr); while Present (Par) and then Nkind (Par) /= N_Pragma_Argument_Association |