This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to dwarf{2,}out.c
- To: gcc-patches at gcc dot gnu dot org
- Subject: Patch to dwarf{2,}out.c
- From: Jason Merrill <jason at cygnus dot com>
- Date: Tue, 22 Feb 2000 14:03:45 -0800
I only just noticed that Kenner's change to use label subtraction to
calculate the size of the dwarf2 line number information put the end
label in the middle of the information. Oops.
Also, the tests for local classes were incorrect.
2000-02-21 Jason Merrill <jason@casey.cygnus.com>
* dwarf2out.c (output_line_info): Put the marker for the end of
the line number info at the actual end.
(gen_struct_or_union_type_die): Use decl_function_context
to check for local classes.
* dwarfout.c (output_type): Likewise.
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/dwarf2out.c,v
retrieving revision 1.151
diff -c -p -r1.151 dwarf2out.c
*** dwarf2out.c 2000/02/20 01:10:47 1.151
--- dwarf2out.c 2000/02/22 22:00:38
*************** dwarf2out.c PARAMS ((dw_die
*** 2398,2403 ****
--- 2398,2405 ----
enum dwarf_attribute));
static unsigned get_AT_unsigned PARAMS ((dw_die_ref,
enum dwarf_attribute));
+ static inline dw_die_ref get_AT_ref PARAMS ((dw_die_ref,
+ enum dwarf_attribute));
static int is_c_family PARAMS ((void));
static int is_fortran PARAMS ((void));
static void remove_AT PARAMS ((dw_die_ref,
*************** get_AT_unsigned (die, attr_kind)
*** 3876,3882 ****
return AT_unsigned (a);
}
- static inline dw_die_ref get_AT_ref PARAMS ((dw_die_ref, enum dwarf_attribute));
static inline dw_die_ref
get_AT_ref (die, attr_kind)
dw_die_ref die;
--- 3878,3883 ----
*************** output_line_info ()
*** 5730,5737 ****
fputc ('\n', asm_out_file);
}
- /* Output the marker for the end of the line number info. */
- ASM_OUTPUT_LABEL (asm_out_file, ".LTEND");
ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
if (flag_debug_asm)
fprintf (asm_out_file, "\t%s DW_LNE_end_sequence", ASM_COMMENT_START);
--- 5731,5736 ----
*************** output_line_info ()
*** 5926,5931 ****
--- 5925,5933 ----
fputc ('\n', asm_out_file);
}
}
+
+ /* Output the marker for the end of the line number info. */
+ ASM_OUTPUT_LABEL (asm_out_file, ".LTEND");
}
/* Given a pointer to a BLOCK node return non-zero if (and only if) the node
*************** gen_struct_or_union_type_die (type, cont
*** 8881,8887 ****
add_AT_flag (type_die, DW_AT_declaration, 1);
/* We don't need to do this for function-local types. */
! if (context_die)
add_incomplete_type (type);
}
}
--- 8883,8889 ----
add_AT_flag (type_die, DW_AT_declaration, 1);
/* We don't need to do this for function-local types. */
! if (! decl_function_context (TYPE_STUB_DECL (type)))
add_incomplete_type (type);
}
}
Index: dwarfout.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/dwarfout.c,v
retrieving revision 1.53
diff -c -p -r1.53 dwarfout.c
*** dwarfout.c 2000/02/15 16:36:32 1.53
--- dwarfout.c 2000/02/22 22:00:41
*************** output_type (type, containing_scope)
*** 4456,4464 ****
|| TREE_CODE (TYPE_CONTEXT (type)) == NAMESPACE_DECL)
&& !finalizing)
{
! /* We can't do this for function-local types, and we don't need
! to. */
! if (TREE_PERMANENT (type))
add_incomplete_type (type);
return; /* EARLY EXIT! Avoid setting TREE_ASM_WRITTEN. */
}
--- 4456,4463 ----
|| TREE_CODE (TYPE_CONTEXT (type)) == NAMESPACE_DECL)
&& !finalizing)
{
! /* We don't need to do this for function-local types. */
! if (! decl_function_context (TYPE_STUB_DECL (type)))
add_incomplete_type (type);
return; /* EARLY EXIT! Avoid setting TREE_ASM_WRITTEN. */
}