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