From: Piotr Trojanek Date: Wed, 9 Dec 2020 16:02:26 +0000 (+0100) Subject: [Ada] Simplify folding of selected components with qualified prefixes X-Git-Tag: basepoints/gcc-13~8113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43d5138227078bf9fca4f9b40074609cf51f8e69;p=thirdparty%2Fgcc.git [Ada] Simplify folding of selected components with qualified prefixes gcc/ada/ * sem_eval.adb (Eval_Selected_Component): Simplify with Unqualify. --- diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 263b9fdd530b..7b1e48d8ded6 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -3847,11 +3847,7 @@ package body Sem_Eval is -- Simplify a selected_component on an aggregate by extracting -- the field directly. - Node := Prefix (N); - - while Nkind (Node) = N_Qualified_Expression loop - Node := Expression (Node); - end loop; + Node := Unqualify (Prefix (N)); if Nkind (Node) = N_Aggregate then Comp := First (Component_Associations (Node));