aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2000-03-03 19:48:46 -0500
committerJason Merrill <jason@gcc.gnu.org>2000-03-03 19:48:46 -0500
commitfcd7f76b289ddadbb67057154547d570b94f2b23 (patch)
tree29b58916ce9e193f2b31a39bfb2eb5cdae4dfcef /gcc/dwarf2out.c
parent6db201439a6635a374ec572561d961c9cf734ee2 (diff)
downloadgcc-fcd7f76b289ddadbb67057154547d570b94f2b23.zip
gcc-fcd7f76b289ddadbb67057154547d570b94f2b23.tar.gz
gcc-fcd7f76b289ddadbb67057154547d570b94f2b23.tar.bz2
dwarf2out.c (dwarf2out_frame_debug): Add cast to silence warning.
* dwarf2out.c (dwarf2out_frame_debug): Add cast to silence warning. (dwarf2out_decl): Functions can now have DECL_IGNORED_P. (gen_decl_die): Likewise. * dwarfout.c (dwarfout_file_scope_decl): Likewise. (output_decl): Likewise. * varasm.c (make_function_rtl): If we change the name used in the rtl, update DECL_ASSEMBLER_NAME accordingly. (make_decl_rtl): Likewise. * toplev.c (rest_of_compilation): Tweak formatting. * toplev.c (rest_of_compilation): find_loop_tree_blocks before remove_unnecessary_notes. (debug_ignore_block): New fn. * toplev.h: Declare it. * emit-rtl.c (remove_unncessary_notes): Call it. * dwarf2out.c (dwarf2out_ignore_block): New fn. * dwarf2out.h: Declare it. * final.c (final_start_function): Don't call remove_unnecessary_notes if we did insn scheduling. From-SVN: r32320
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c53
1 files changed, 32 insertions, 21 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index d3b84cd..cb8b723 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1355,7 +1355,7 @@ dwarf2out_frame_debug (insn)
{
/* Set up state for generating call frame debug info. */
lookup_cfa (&cfa_reg, &cfa_offset);
- if (cfa_reg != DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM))
+ if (cfa_reg != (unsigned long) DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM))
abort ();
cfa_reg = STACK_POINTER_REGNUM;
cfa_store_reg = cfa_reg;
@@ -9296,12 +9296,8 @@ gen_decl_die (decl, context_die)
if (TREE_CODE (decl) == ERROR_MARK)
return;
- /* If this ..._DECL node is marked to be ignored, then ignore it. But don't
- ignore a function definition, since that would screw up our count of
- blocks, and that in turn will completely screw up the labels we will
- reference in subsequent DW_AT_low_pc and DW_AT_high_pc attributes (for
- subsequent blocks). */
- if (DECL_IGNORED_P (decl) && TREE_CODE (decl) != FUNCTION_DECL)
+ /* If this ..._DECL node is marked to be ignored, then ignore it. */
+ if (DECL_IGNORED_P (decl))
return;
switch (TREE_CODE (decl))
@@ -9460,21 +9456,9 @@ dwarf2out_decl (decl)
if (TREE_CODE (decl) == ERROR_MARK)
return;
- /* If this ..._DECL node is marked to be ignored, then ignore it. We gotta
- hope that the node in question doesn't represent a function definition.
- If it does, then totally ignoring it is bound to screw up our count of
- blocks, and that in turn will completely screw up the labels we will
- reference in subsequent DW_AT_low_pc and DW_AT_high_pc attributes (for
- subsequent blocks). (It's too bad that BLOCK nodes don't carry their
- own sequence numbers with them!) */
+ /* If this ..._DECL node is marked to be ignored, then ignore it. */
if (DECL_IGNORED_P (decl))
- {
- if (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_INITIAL (decl) != NULL)
- abort ();
-
- return;
- }
+ return;
switch (TREE_CODE (decl))
{
@@ -9594,6 +9578,33 @@ dwarf2out_end_block (blocknum)
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, BLOCK_END_LABEL, blocknum);
}
+/* We've decided not to emit any debugging information for BLOCK; make
+ sure that we don't end up with orphans as a result. */
+
+void
+dwarf2out_ignore_block (block)
+ tree block;
+{
+ tree decl;
+ for (decl = BLOCK_VARS (block); decl; decl = TREE_CHAIN (decl))
+ {
+ dw_die_ref die;
+
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ die = lookup_decl_die (decl);
+ else if (TREE_CODE (decl) == TYPE_DECL && TYPE_DECL_IS_STUB (decl))
+ die = lookup_type_die (TREE_TYPE (decl));
+ else
+ die = NULL;
+
+ /* Just give them a dummy value for parent so dwarf2out_finish
+ doesn't blow up; we would use add_child_die if we really
+ wanted to add them to comp_unit_die's children. */
+ if (die && die->die_parent == 0)
+ die->die_parent = comp_unit_die;
+ }
+}
+
/* Output a marker (i.e. a label) at a point in the assembly code which
corresponds to a given source level label. */