Commit 80ec8b4c by Eric Botcazou

decl.c (gnat_to_gnu_entity): Defer finalizing types when updating the pointers…

decl.c (gnat_to_gnu_entity): Defer finalizing types when updating the pointers to the designated type.

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Type>: Defer
	finalizing types when updating the pointers to the designated type.
	<all>: Finalize the deferred types even if we didn't defer processing
	of incomplete types in this invocation.

From-SVN: r171879
parent bb0ce33a
2011-04-02 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Type>: Defer
finalizing types when updating the pointers to the designated type.
<all>: Finalize the deferred types even if we didn't defer processing
of incomplete types in this invocation.
2011-04-01 Olivier Hainque <hainque@adacore.com>
Nicolas Setton <setton@adacore.com>
Eric Botcazou <ebotcazou@adacore.com>
......@@ -8,27 +15,23 @@
2011-03-28 Kai Tietz <ktietz@redhat.com>
* gcc-interface/Makefile.in (SO_LIB): Handle multilib build for native
windows targets.
(EH_MECHANISM): Make sure we use gcc's exception mechanism for all
native windows target.
* system-mingw.ads (System): Change ZCX_By_Default default to
True.
Windows targets.
(EH_MECHANISM): Use GCC exception mechanism for native Windows targets.
* system-mingw.ads (System): Change ZCX_By_Default default to True.
* raise-gcc.c (PERSONALITY_FUNCTION): Add prototype to
prevent warning.
* raise-gcc.c (PERSONALITY_FUNCTION): Add prototype.
2011-03-28 Tristan Gingold <gingold@adacore.com>
PR ada/44431
* gcc-interface/Make-lang.in (ada/b_gnat1.adb): Replaces
ada/b_gnat1.c. Use ada output of gnatbind.
* gcc-interface/Make-lang.in (ada/b_gnat1.adb): Replace ada/b_gnat1.c.
Use ada output of gnatbind.
(ada/b_gnatb.adb): Ditto.
(ada/b_gnat1.o, ada/b_gnatb.o): New rules.
(ada.mostlyclean, ada.stage1)
(ada.stage2, ada.stage3, ada.stage4, ada.stageprofile)
(ada.stagefeedback): Adjust.
* gcc-interface/Makefile.in (b_gnatl.adb): Replaces b_gnatl.c
* gcc-interface/Makefile.in (b_gnatl.adb): Replace b_gnatl.c.
Use ada output of gnatbind.
(b_gnatm.adb): Ditto.
(b_gnatl.o, b_gnatm.o): New rules.
......
......@@ -3769,8 +3769,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
along the way. update_pointer_to is expected to properly take
care of those situations. */
if (defer_incomplete_level == 0 && !is_from_limited_with)
{
defer_finalize_level++;
update_pointer_to (TYPE_MAIN_VARIANT (gnu_old_desig_type),
gnat_to_gnu_type (gnat_desig_equiv));
defer_finalize_level--;
}
else
{
struct incomplete *p = XNEW (struct incomplete);
......@@ -4968,10 +4972,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
}
/* If we deferred processing of incomplete types, re-enable it. If there
were no other disables and we have some to process, do so. */
if (this_deferred && --defer_incomplete_level == 0)
{
if (defer_incomplete_list)
were no other disables and we have deferred types to process, do so. */
if (this_deferred
&& --defer_incomplete_level == 0
&& defer_incomplete_list)
{
struct incomplete *p, *next;
......@@ -4999,9 +5003,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
defer_finalize_level--;
}
/* All the deferred incomplete types have been processed so we can
now proceed with the finalization of the deferred types. */
if (defer_finalize_level == 0 && defer_finalize_list)
/* If all the deferred incomplete types have been processed, we can proceed
with the finalization of the deferred types. */
if (defer_incomplete_level == 0
&& defer_finalize_level == 0
&& defer_finalize_list)
{
unsigned int i;
tree t;
......@@ -5011,7 +5017,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
VEC_free (tree, heap, defer_finalize_list);
}
}
/* If we are not defining this type, see if it's on one of the lists of
incomplete types. If so, handle the list entry now. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment