[Ada] Remove explicit expansion of block with general case statement

Message ID 20220107162709.GA948459@adacore.com
State Committed
Commit 69a6631a6ff0074083da528e3eec7dbf4997a609
Headers
Series [Ada] Remove explicit expansion of block with general case statement |

Commit Message

Pierre-Marie de Rodat Jan. 7, 2022, 4:27 p.m. UTC
  When a general case statements is rewritten into a block, it is enough
to call Analyze on this block node, because analysis of non-expressions
automatically triggers expansion.

Cleanup originating from investigating many variants of routines for
(pre)analysis and resolution.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* exp_ch5.adb (Expand_N_Case_Statement): Remove explicit
	expansion.
  

Patch

diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -39,7 +39,6 @@  with Exp_Dbug;       use Exp_Dbug;
 with Exp_Pakd;       use Exp_Pakd;
 with Exp_Tss;        use Exp_Tss;
 with Exp_Util;       use Exp_Util;
-with Expander;       use Expander;
 with Inline;         use Inline;
 with Namet;          use Namet;
 with Nlists;         use Nlists;
@@ -3876,7 +3875,6 @@  package body Exp_Ch5 is
       if Extensions_Allowed and then not Is_Discrete_Type (Etype (Expr)) then
          Rewrite (N, Expand_General_Case_Statement);
          Analyze (N);
-         Expand (N);
          return;
       end if;