+Fri Mar 8 11:47:26 1996 Mike Stump <mrs@cygnus.com>
+
+ * tree.c (unsave_expr): Don't unsave, UNSAVE_EXPRs.
+
+Fri Mar 8 11:29:06 1996 Mike Stump <mrs@cygnus.com>
+
+ * decl.c (cp_finish_decl): The exception regions have to be
+ nested, not overlapping. We start the exception region for a
+ decl, after it has been fully built, and all temporaries for it
+ have been cleaned up.
+
+Thu Mar 7 17:46:06 1996 Mike Stump <mrs@cygnus.com>
+
+ * tree.c (vec_binfo_member): Don't core dump if we have no bases.
+
Thu Mar 7 14:11:49 1996 Jason Merrill <jason@yorick.cygnus.com>
* tree.def: Add RETURN_INIT.
&& cleanup == NULL_TREE
&& DECL_NAME (decl))
TREE_USED (decl) = 0;
+ }
+ /* Cleanup any temporaries needed for the initial value. */
+ expand_cleanups_to (old_cleanups);
+ pop_temp_slots ();
+ pop_temp_slots ();
+ target_temp_slot_level = old_temp_level;
+ if (DECL_SIZE (decl) && type != error_mark_node)
+ {
/* Store the cleanup, if there was one. */
if (cleanup)
{
decl);
}
}
- /* Cleanup any temporaries needed for the initial value. */
- expand_cleanups_to (old_cleanups);
- pop_temp_slots ();
- pop_temp_slots ();
- target_temp_slot_level = old_temp_level;
}
finish_end0:
return mapcar (t, bot_manip);
}
+/* Arrange for an expression to be expanded multiple independent
+ times. This is useful for cleanup actions, as the backend can
+ expand them multiple times in different places. */
tree
unsave_expr (expr)
tree expr;
{
tree t;
+ /* If this is already protected, no sense in protecting it again. */
+ if (TREE_CODE (expr) == UNSAVE_EXPR)
+ return expr;
+
t = build1 (UNSAVE_EXPR, TREE_TYPE (expr), expr);
TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (expr);
return t;
}
/* Return first vector element whose BINFO_TYPE is ELEM.
- Return 0 if ELEM is not in VEC. */
+ Return 0 if ELEM is not in VEC. VEC may be NULL_TREE. */
tree
vec_binfo_member (elem, vec)
tree elem, vec;
{
int i;
- for (i = 0; i < TREE_VEC_LENGTH (vec); ++i)
- if (elem == BINFO_TYPE (TREE_VEC_ELT (vec, i)))
- return TREE_VEC_ELT (vec, i);
+
+ if (vec)
+ for (i = 0; i < TREE_VEC_LENGTH (vec); ++i)
+ if (elem == BINFO_TYPE (TREE_VEC_ELT (vec, i)))
+ return TREE_VEC_ELT (vec, i);
+
return NULL_TREE;
}