aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorJason Merrill <jason@casey.cygnus.com>2000-05-02 20:43:24 +0000
committerJason Merrill <jason@gcc.gnu.org>2000-05-02 16:43:24 -0400
commit64b59a80f755d6ca6b1ab909f2a267c3376803ad (patch)
treea122f23eb74b7af597fd74a1558c5fac6ab9e969 /gcc/dwarf2out.c
parent7145d9fe6bb782d384cab328c028507b4f8f435a (diff)
downloadgcc-64b59a80f755d6ca6b1ab909f2a267c3376803ad.zip
gcc-64b59a80f755d6ca6b1ab909f2a267c3376803ad.tar.gz
gcc-64b59a80f755d6ca6b1ab909f2a267c3376803ad.tar.bz2
toplev.c (debug_ignore_block): Return int.
* toplev.c (debug_ignore_block): Return int. * dwarf2out.c (dwarf2out_ignore_block): Likewise. * toplev.h, dwarf2out.h: Adjust. * emit-rtl.c (remove_unnecessary_notes): Test return value. * emit-rtl.c (remove_unnecessary_notes): Fix spelling of "necessary". * toplev.c, final.c, rtl.h: Adjust. From-SVN: r33616
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index bf93491..2e1b689 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -9598,31 +9598,23 @@ 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. */
+/* Returns nonzero if it is appropriate not to emit any debugging
+ information for BLOCK, because it doesn't contain any instructions.
-void
+ Don't allow this for blocks with nested functions or local classes
+ as we would end up with orphans, and in the presence of scheduling
+ we may end up calling them anyway. */
+
+int
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;
- }
+ if (TREE_CODE (decl) == FUNCTION_DECL
+ || (TREE_CODE (decl) == TYPE_DECL && TYPE_DECL_IS_STUB (decl)))
+ return 0;
+ return 1;
}
/* Output a marker (i.e. a label) at a point in the assembly code which