]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Remove dead code for scope entity having E_Subprogram_Body kind
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 3 Feb 2022 14:11:26 +0000 (15:11 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 19 May 2022 14:05:27 +0000 (14:05 +0000)
In GNAT AST the Scope field always points to the semantic scope (e.g.
subprogram) and never to syntactic scope (e.g. subprogram body).

Cleanup related to handling of circular access-to-record types.

gcc/ada/

* gcc-interface/decl.cc (gnat_to_gnu_entity): Remove dead code
which expected Scope to return E_Subprogram_Body entity.

gcc/ada/gcc-interface/decl.cc

index 28e1ab7ce8159ae86e7f147b98f26dfbcd21316c..aae1ef10509a780afe963971e7ae49d7cac7edcb 100644 (file)
@@ -363,10 +363,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
          if (Is_Type (gnat_temp))
            gnat_temp = Underlying_Type (gnat_temp);
 
-         if (Ekind (gnat_temp) == E_Subprogram_Body)
-           gnat_temp
-             = Corresponding_Spec (Parent (Declaration_Node (gnat_temp)));
-
          if (Is_Subprogram (gnat_temp)
              && Present (Protected_Body_Subprogram (gnat_temp)))
            gnat_temp = Protected_Body_Subprogram (gnat_temp);