aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2018-05-29 09:41:45 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-05-29 09:41:45 +0000
commit14f8ba9ad1d587528208b9f759849333a19918d8 (patch)
tree224aab2a85d5aeddcdae97d5e089f985a92fd5a0
parentec3b72c55d064424cd9ed3b92b1bd7be5b501ecd (diff)
downloadgcc-14f8ba9ad1d587528208b9f759849333a19918d8.zip
gcc-14f8ba9ad1d587528208b9f759849333a19918d8.tar.gz
gcc-14f8ba9ad1d587528208b9f759849333a19918d8.tar.bz2
[Ada] Unnesting: exclude selected components whose prefix carry no type
2018-05-29 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_unst.adb (Visit_Node): Exclude selected components whose prefix carry no type. Such selected components appear in unit names that are child units, both in the specification and possibly in an end label for the unit, and they do not contain any relevant uplevel references. From-SVN: r260879
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/exp_unst.adb8
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 3eb0a41..4eb12c5 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+2018-05-29 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_unst.adb (Visit_Node): Exclude selected components whose prefix
+ carry no type. Such selected components appear in unit names that are
+ child units, both in the specification and possibly in an end label for
+ the unit, and they do not contain any relevant uplevel references.
+
2018-05-29 Arnaud Charlet <charlet@adacore.com>
* libgnat/a-calend.ads, libgnat/a-calend.adb (Epoch_Offset): Make it a
diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb
index 03f316a..b1383f9 100644
--- a/gcc/ada/exp_unst.adb
+++ b/gcc/ada/exp_unst.adb
@@ -753,7 +753,13 @@ package body Exp_Unst is
-- simplify the processing here by examining all components
-- of the record.
- elsif Nkind (N) = N_Selected_Component then
+ -- Selected components appear as unit names and end labels for
+ -- child units. The prefixes of these nodes denote parent
+ -- units and carry no type information so they are skipped.
+
+ elsif Nkind (N) = N_Selected_Component
+ and then Present (Etype (Prefix (N)))
+ then
declare
DT : Boolean := False;
begin