+2005-01-18 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR debug/16261
+ Backport from mainline:
+ 2004-01-27 Devang Patel <dpatel@apple.com>
+
+ * dwarf2out.c: (remove_child_TAG): New function.
+ (gen_subprogram_die): Do not remove all children dies while reusing
+ declaration die for definition. Instead, selectively remove only
+ formal parameters.
+
2005-01-18 Eric Botcazou <ebotcazou@libertysurf.fr>
PR rtl-optimization/19296
static bool is_fortran (void);
static bool is_ada (void);
static void remove_AT (dw_die_ref, enum dwarf_attribute);
+static void remove_child_TAG (dw_die_ref, enum dwarf_tag);
static inline void free_die (dw_die_ref);
static void remove_children (dw_die_ref);
static void add_child_die (dw_die_ref, dw_die_ref);
}
}
+/* Remove child die whose die_tag is specified tag. */
+
+static void
+remove_child_TAG (dw_die_ref die, enum dwarf_tag tag)
+{
+ dw_die_ref current, prev, next;
+ current = die->die_child;
+ prev = NULL;
+ while (current != NULL)
+ {
+ if (current->die_tag == tag)
+ {
+ next = current->die_sib;
+ if (prev == NULL)
+ die->die_child = next;
+ else
+ prev->die_sib = next;
+ free_die (current);
+ current = next;
+ }
+ else
+ {
+ prev = current;
+ current = current->die_sib;
+ }
+ }
+}
+
/* Free up the memory used by DIE. */
static inline void
{
subr_die = old_die;
- /* Clear out the declaration attribute and the parm types. */
+ /* Clear out the declaration attribute and the formal parameters. */
remove_AT (subr_die, DW_AT_declaration);
- remove_children (subr_die);
+ remove_child_TAG (subr_die, DW_TAG_formal_parameter);
}
else
{