* [Ada] Remove dead code for scope entity having E_Subprogram_Body kind
@ 2022-05-19 14:15 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-19 14:15 UTC (permalink / raw)
To: gcc-patches; +Cc: Piotr Trojanek
[-- Attachment #1: Type: text/plain, Size: 383 bytes --]
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.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* gcc-interface/decl.cc (gnat_to_gnu_entity): Remove dead code
which expected Scope to return E_Subprogram_Body entity.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 610 bytes --]
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-19 14:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19 14:15 [Ada] Remove dead code for scope entity having E_Subprogram_Body kind Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).