From: Ed Schonberg Date: Thu, 4 Jul 2019 08:05:50 +0000 (+0000) Subject: [Ada] Unnesting: handle conditional expressions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c3c41b296a71e77742d3edb3494945537cd72983;p=gcc.git [Ada] Unnesting: handle conditional expressions 2019-07-04 Ed Schonberg gcc/ada/ * exp_unst.adb: Handle conditional expressions. From-SVN: r273053 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 07c37477b58..c60ab6dec79 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2019-07-04 Ed Schonberg + + * exp_unst.adb: Handle conditional expressions. + 2019-07-04 Yannick Moy * sem_spark.adb (Check_Package_Spec, Check_Package_Body): Only diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index b81b1b97a2d..6717610bfbe 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -598,6 +598,33 @@ package body Exp_Unst is then Note_Uplevel_Bound (Prefix (N), Ref); + -- Conditional expressions. + + elsif Nkind (N) = N_If_Expression then + declare + Expr : Node_Id; + + begin + Expr := First (Expressions (N)); + while Present (Expr) loop + Note_Uplevel_Bound (Expr, Ref); + Next (Expr); + end loop; + end; + + elsif Nkind (N) = N_Case_Expression then + declare + Alternative : Node_Id; + + begin + Note_Uplevel_Bound (Expression (N), Ref); + + Alternative := First (Alternatives (N)); + while Present (Alternative) loop + Note_Uplevel_Bound (Expression (Alternative), Ref); + end loop; + end; + -- Conversion case elsif Nkind (N) = N_Type_Conversion then