* [Ada] Minor tweaks in gnat_to_gnu
@ 2012-11-09 11:07 Eric Botcazou
0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2012-11-09 11:07 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 534 bytes --]
This fixes a couple of cases where gnat_to_gnu would recurse on an empty node
and removes all traces of SCIL references from gigi.
Tested on x86_64-suse-linux, applied on mainline.
2012-11-09 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (gnat_to_gnu) <N_Subprogram_Body_Stub>: Deal
with a missing library unit instead of calling gnat_to_gnu on Emtpy.
Remove last bits of support for SCIL nodes. Add cases for nodes that
should only be present when annotating types. Add default abort.
--
Eric Botcazou
[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 1514 bytes --]
Index: gcc-interface/trans.c
===================================================================
--- gcc-interface/trans.c (revision 193322)
+++ gcc-interface/trans.c (working copy)
@@ -6493,7 +6493,13 @@ gnat_to_gnu (Node_Id gnat_node)
case N_Protected_Body_Stub:
case N_Task_Body_Stub:
/* Simply process whatever unit is being inserted. */
- gnu_result = gnat_to_gnu (Unit (Library_Unit (gnat_node)));
+ if (Present (Library_Unit (gnat_node)))
+ gnu_result = gnat_to_gnu (Unit (Library_Unit (gnat_node)));
+ else
+ {
+ gcc_assert (type_annotate_only);
+ gnu_result = alloc_stmt_list ();
+ }
break;
case N_Subunit:
@@ -6855,11 +6861,20 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_result = alloc_stmt_list ();
break;
- default:
- /* SCIL nodes require no processing for GCC. Other nodes should only
- be present when annotating types. */
- gcc_assert (IN (kind, N_SCIL_Node) || type_annotate_only);
+ case N_Function_Specification:
+ case N_Procedure_Specification:
+ case N_Op_Concat:
+ case N_Component_Association:
+ case N_Protected_Body:
+ case N_Task_Body:
+ /* These nodes should only be present when annotating types. */
+ gcc_assert (type_annotate_only);
gnu_result = alloc_stmt_list ();
+ break;
+
+ default:
+ /* Other nodes are not supposed to reach here. */
+ gcc_unreachable ();
}
/* If we pushed the processing of the elaboration routine, pop it back. */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-11-09 11:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-09 11:07 [Ada] Minor tweaks in gnat_to_gnu Eric Botcazou
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).