This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to dwarf2out.c handling abstract origin attributes
- To: gcc-patches at gcc dot gnu dot org
- Subject: Patch to dwarf2out.c handling abstract origin attributes
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Tue, 21 Sep 1999 13:54:26 +0100
Hi Guys,
I would like to submit the following small patch. It handles a rare
case where add_abstract_origin_attribute() is unable to generate a
valid attribute because the context for the origin is no longer
available. This case occurs for some test cases using the beos
targeted toolchain.
Cheers
Nick
Tue Sep 21 13:51:13 1999 Nick Clifton <nickc@cygnus.com>
* dwarf2out.c (add_abstract_origin_attribute): Do not complain
if the attribute could not be generated because the context is
no longer available.
Index: dwarf2out.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/dwarf2out.c,v
retrieving revision 1.114
diff -p -r1.114 dwarf2out.c
*** dwarf2out.c 1999/09/09 21:36:19 1.114
--- dwarf2out.c 1999/09/21 12:46:29
*************** add_abstract_origin_attribute (die, orig
*** 7624,7634 ****
--- 7624,7645 ----
register tree origin;
{
dw_die_ref origin_die = NULL;
+
if (TREE_CODE_CLASS (TREE_CODE (origin)) == 'd')
origin_die = lookup_decl_die (origin);
else if (TREE_CODE_CLASS (TREE_CODE (origin)) == 't')
origin_die = lookup_type_die (origin);
+ if (origin_die == NULL)
+ {
+ /* If we could not compute the origin because we have no context
+ for it, then do not generate a die, otherwise complain. */
+ if (DECL_CONTEXT (origin))
+ abort ();
+ else
+ return;
+ }
+
add_AT_die_ref (die, DW_AT_abstract_origin, origin_die);
}