[Ada] Unnesting: allow uplevel references to exceptions
authorEd Schonberg <schonberg@adacore.com>
Mon, 28 May 2018 08:55:57 +0000 (08:55 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 28 May 2018 08:55:57 +0000 (08:55 +0000)
2018-05-28  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* einfo.ads, einfo.adb: Exceptions can be uplevel references, and thus
they can appear as components of activation records.
* exp_unst.adb (Visit_Node): A reference to an exception may be an
uplevel reference.

From-SVN: r260840

gcc/ada/ChangeLog
gcc/ada/einfo.adb
gcc/ada/einfo.ads
gcc/ada/exp_unst.adb

index 79df7a63e145e2d68ddb8d73a340feed2bbdfb5a..91ea8ec63cc1280053cd164146c01243a3f4e084 100644 (file)
@@ -1,3 +1,10 @@
+2018-05-28  Ed Schonberg  <schonberg@adacore.com>
+
+       * einfo.ads, einfo.adb: Exceptions can be uplevel references, and thus
+       they can appear as components of activation records.
+       * exp_unst.adb (Visit_Node): A reference to an exception may be an
+       uplevel reference.
+
 2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>
 
        * exp_ch4.adb (Expand_Composite_Equality): Compute whether the size
index 8ff9562b97570a5bbe6ee0f03996dcb7fc980ebd..fd77d411724371614ce5ad81abb7796e446ced04 100644 (file)
@@ -744,6 +744,7 @@ package body Einfo is
    begin
       pragma Assert (Ekind_In (Id, E_Constant,
                                    E_Discriminant,
+                                   E_Exception,
                                    E_In_Parameter,
                                    E_In_Out_Parameter,
                                    E_Loop_Parameter,
@@ -3958,6 +3959,7 @@ package body Einfo is
    begin
       pragma Assert (Ekind_In (Id, E_Constant,
                                    E_Discriminant,
+                                   E_Exception,
                                    E_In_Parameter,
                                    E_In_Out_Parameter,
                                    E_Loop_Parameter,
index 78504bb9a7b67cf76ee6dab93a5c2d4ecb212f88..665d5786b628a82ab6bd8f7298783058966aaadd 100644 (file)
@@ -6106,6 +6106,7 @@ package Einfo is
    --    Renamed_Entity                      (Node18)
    --    Register_Exception_Call             (Node20)
    --    Interface_Name                      (Node21)
+   --    Activation_Record_Component         (Node31)
    --    Discard_Names                       (Flag88)
    --    Is_Raised                           (Flag224)
 
index f6d76503fe0385480ac655f73a9f18c87d73e2fb..81f2a61cfb917ea7be83328419562b63704b8449 100644 (file)
@@ -798,9 +798,10 @@ package body Exp_Unst is
                  and then Chars (Enclosing_Subprogram (Ent)) /= Name_uParent
                  and then
 
-                   --  Constants and variables are interesting
+                   --  Constants, variables and exceptions are potentially
+                   --  uplevel references to global declarations.
 
-                   (Ekind_In (Ent, E_Constant, E_Variable)
+                   (Ekind_In (Ent, E_Constant, E_Exception, E_Variable)
 
                      --  Formals are interesting, but not if being used as mere
                      --  names of parameters for name notation calls.