aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-12-09 17:02:26 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2021-04-28 05:38:10 -0400
commit43d5138227078bf9fca4f9b40074609cf51f8e69 (patch)
tree557b520df369344aeee5c5dab97f507785aae5f7 /gcc
parent35e3a1f670dc5ef033184ef1103f8d4e0fb42d1e (diff)
downloadgcc-43d5138227078bf9fca4f9b40074609cf51f8e69.zip
gcc-43d5138227078bf9fca4f9b40074609cf51f8e69.tar.gz
gcc-43d5138227078bf9fca4f9b40074609cf51f8e69.tar.bz2
[Ada] Simplify folding of selected components with qualified prefixes
gcc/ada/ * sem_eval.adb (Eval_Selected_Component): Simplify with Unqualify.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_eval.adb6
1 files changed, 1 insertions, 5 deletions
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index 263b9fd..7b1e48d 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));