* 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
+2000-05-02 Jason Merrill <jason@casey.cygnus.com>
+
+ * Makefile.in (WARN_CFLAGS): Add -pedantic -Wno-long-long.
+ (LOOSE_CFLAGS): New: CFLAGS without -pedantic and -Wtraditional.
+ (GCC_CFLAGS): Use it.
+ (LANG_FLAGS_TO_PASS): New: SUBDIR_FLAGS_TO_PASS with LOOSE_CFLAGS.
+ * cp/Make-lang.in, java/Make-lang.in, f/Make-lang.in, ch/Make-lang.in,
+ objc/Make-lang.in: Use it.
+
+ * 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.
+
2000-05-02 Zack Weinberg <zack@wolery.cumb.org>
* aclocal.m4 (gcc_AC_CHECK_PROG_VER): New macro.
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
extern void dwarf2out_begin_block PARAMS ((unsigned));
extern void dwarf2out_end_block PARAMS ((unsigned));
-extern void dwarf2out_ignore_block PARAMS ((tree));
+extern int dwarf2out_ignore_block PARAMS ((tree));
extern void dwarf2out_label PARAMS ((rtx));
extern void dwarf2out_decl PARAMS ((tree));
extern void dwarf2out_line PARAMS ((const char *, unsigned));
to);
}
-/* Remove unncessary notes from the instruction stream. */
+/* Remove unnecessary notes from the instruction stream. */
void
-remove_unncessary_notes ()
+remove_unnecessary_notes ()
{
rtx insn;
rtx next;
if (NOTE_BLOCK (prev) != NOTE_BLOCK (insn))
abort ();
- /* Never delete the BLOCK for the outermost scope
- of the function; we can refer to names from
- that scope even if the block notes are messed up. */
- if (! is_body_block (NOTE_BLOCK (insn)))
+ if (debug_ignore_block (NOTE_BLOCK (insn)))
{
- debug_ignore_block (NOTE_BLOCK (insn));
-
remove_insn (prev);
remove_insn (insn);
}
/* Then remove any notes we don't need. That will make iterating
over the instruction sequence faster, and allow the garbage
collector to reclaim the memory used by the notes. */
- remove_unncessary_notes ();
+ remove_unnecessary_notes ();
/* In function-at-a-time mode, we do not attempt to keep the BLOCK
tree in sensible shape. So, we just recalculate it here. */
#endif /* DWARF2_DEBUGGING_INFO */
}
-/* Tell the debugging backend that we've decided not to emit any
- debugging information for BLOCK, so it can clean up after any local
- classes or nested functions. */
+/* Returns nonzero if it is appropriate not to emit any debugging
+ information for BLOCK, because it doesn't contain any instructions.
+ This may not be the case for blocks containing nested functions, since
+ we may actually call such a function even though the BLOCK information
+ is messed up. */
-void
+int
debug_ignore_block (block)
tree block ATTRIBUTE_UNUSED;
{
+ /* Never delete the BLOCK for the outermost scope
+ of the function; we can refer to names from
+ that scope even if the block notes are messed up. */
+ if (is_body_block (block))
+ return 0;
+
#ifdef DWARF2_DEBUGGING_INFO
if (write_symbols == DWARF2_DEBUG)
- dwarf2out_ignore_block (block);
+ return dwarf2out_ignore_block (block);
#endif
+
+ return 1;
}
extern void debug_end_source_file PARAMS ((unsigned));
extern void debug_define PARAMS ((unsigned, char *));
extern void debug_undef PARAMS ((unsigned, char *));
-extern void debug_ignore_block PARAMS ((union tree_node *));
+extern int debug_ignore_block PARAMS ((union tree_node *));
extern void fatal PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
extern void fatal_io_error PARAMS ((const char *))