tree.h (DECL_IGNORED_P): Document further effect for FUNCTION_DECL.

* tree.h (DECL_IGNORED_P): Document further effect for FUNCTION_DECL.
	* dbxout.c (dbxout_function_end): Do not test DECL_IGNORED_P.
	(dbxout_begin_function): Likewise.
	* final.c (dwarf2_debug_info_emitted_p): New predicate.
	(final_start_function): Do not emit debug info if DECL_IGNORED_P is
	set on the function.
	(final_end_function): Likewise.
	(final_scan_insn): Likewise.
	(rest_of_handle_final): Likewise.
	* varasm.c (assemble_start_function): Likewise.
	* config/rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Likewise.

From-SVN: r151670
This commit is contained in:
Eric Botcazou 2009-09-13 10:46:11 +00:00
parent 75152bcb19
commit 725730f272
6 changed files with 62 additions and 30 deletions

View File

@ -1,4 +1,18 @@
2009-09-10 Jason Merrill <jason@redhat.com>
2009-09-13 Eric Botcazou <ebotcazou@adacore.com>
* tree.h (DECL_IGNORED_P): Document further effect for FUNCTION_DECL.
* dbxout.c (dbxout_function_end): Do not test DECL_IGNORED_P.
(dbxout_begin_function): Likewise.
* final.c (dwarf2_debug_info_emitted_p): New predicate.
(final_start_function): Do not emit debug info if DECL_IGNORED_P is
set on the function.
(final_end_function): Likewise.
(final_scan_insn): Likewise.
(rest_of_handle_final): Likewise.
* varasm.c (assemble_start_function): Likewise.
* config/rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Likewise.
2009-09-12 Jason Merrill <jason@redhat.com>
* dbgcnt.c (dbg_cnt_process_single_pair): constify.
* opts.c (common_handle_option): constify.

View File

@ -190,7 +190,7 @@
putc ('.', FILE); \
RS6000_OUTPUT_BASENAME (FILE, buffer); \
fputs (":\n", FILE); \
if (write_symbols != NO_DEBUG) \
if (write_symbols != NO_DEBUG && !DECL_IGNORED_P (DECL)) \
xcoffout_declare_function (FILE, DECL, buffer); \
}

View File

@ -902,7 +902,7 @@ dbxout_finish_complex_stabs (tree sym, stab_code_type code,
#if defined (DBX_DEBUGGING_INFO)
static void
dbxout_function_end (tree decl)
dbxout_function_end (tree decl ATTRIBUTE_UNUSED)
{
char lscope_label_name[100];
@ -921,8 +921,7 @@ dbxout_function_end (tree decl)
named sections. */
if (!use_gnu_debug_info_extensions
|| NO_DBX_FUNCTION_END
|| !targetm.have_named_sections
|| DECL_IGNORED_P (decl))
|| !targetm.have_named_sections)
return;
/* By convention, GCC will mark the end of a function with an N_FUN
@ -3683,9 +3682,6 @@ dbxout_begin_function (tree decl)
{
int saved_tree_used1;
if (DECL_IGNORED_P (decl))
return;
saved_tree_used1 = TREE_USED (decl);
TREE_USED (decl) = 1;
if (DECL_NAME (DECL_RESULT (decl)) != 0)

View File

@ -1484,6 +1484,20 @@ remap_debug_filename (const char *filename)
return ggc_strdup (s);
}
/* Return true if DWARF2 debug info can be emitted for DECL. */
static bool
dwarf2_debug_info_emitted_p (tree decl)
{
if (write_symbols != DWARF2_DEBUG && write_symbols != VMS_AND_DWARF2_DEBUG)
return false;
if (DECL_IGNORED_P (decl))
return false;
return true;
}
/* Output assembler code for the start of a function,
and initialize some of the variables in this file
for the new function. The label for the function and associated
@ -1508,10 +1522,11 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file,
high_block_linenum = high_function_linenum = last_linenum;
(*debug_hooks->begin_prologue) (last_linenum, last_filename);
if (!DECL_IGNORED_P (current_function_decl))
debug_hooks->begin_prologue (last_linenum, last_filename);
#if defined (DWARF2_UNWIND_INFO) || defined (TARGET_UNWIND_INFO)
if (write_symbols != DWARF2_DEBUG && write_symbols != VMS_AND_DWARF2_DEBUG)
if (!dwarf2_debug_info_emitted_p (current_function_decl))
dwarf2out_begin_prologue (0, NULL);
#endif
@ -1648,17 +1663,19 @@ final_end_function (void)
{
app_disable ();
(*debug_hooks->end_function) (high_function_linenum);
if (!DECL_IGNORED_P (current_function_decl))
debug_hooks->end_function (high_function_linenum);
/* Finally, output the function epilogue:
code to restore the stack frame and return to the caller. */
targetm.asm_out.function_epilogue (asm_out_file, get_frame_size ());
/* And debug output. */
(*debug_hooks->end_epilogue) (last_linenum, last_filename);
if (!DECL_IGNORED_P (current_function_decl))
debug_hooks->end_epilogue (last_linenum, last_filename);
#if defined (DWARF2_UNWIND_INFO)
if (write_symbols != DWARF2_DEBUG && write_symbols != VMS_AND_DWARF2_DEBUG
if (!dwarf2_debug_info_emitted_p (current_function_decl)
&& dwarf2out_do_frame ())
dwarf2out_end_epilogue (last_linenum, last_filename);
#endif
@ -1839,7 +1856,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
dwarf2out_switch_text_section ();
else
#endif
(*debug_hooks->switch_text_section) ();
if (!DECL_IGNORED_P (current_function_decl))
debug_hooks->switch_text_section ();
switch_to_section (current_function_section ());
break;
@ -1905,7 +1923,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
case NOTE_INSN_FUNCTION_BEG:
app_disable ();
(*debug_hooks->end_prologue) (last_linenum, last_filename);
if (!DECL_IGNORED_P (current_function_decl))
debug_hooks->end_prologue (last_linenum, last_filename);
if ((*seen & (SEEN_EMITTED | SEEN_NOTE)) == SEEN_NOTE)
{
@ -1931,7 +1950,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
high_block_linenum = last_linenum;
/* Output debugging info about the symbol-block beginning. */
(*debug_hooks->begin_block) (last_linenum, n);
if (!DECL_IGNORED_P (current_function_decl))
debug_hooks->begin_block (last_linenum, n);
/* Mark this block as output. */
TREE_ASM_WRITTEN (NOTE_BLOCK (insn)) = 1;
@ -1965,7 +1985,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
--block_depth;
gcc_assert (block_depth >= 0);
(*debug_hooks->end_block) (high_block_linenum, n);
if (!DECL_IGNORED_P (current_function_decl))
debug_hooks->end_block (high_block_linenum, n);
}
if (write_symbols == DBX_DEBUG
|| write_symbols == SDB_DEBUG)
@ -1995,7 +2016,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
break;
case NOTE_INSN_VAR_LOCATION:
(*debug_hooks->var_location) (insn);
if (!DECL_IGNORED_P (current_function_decl))
debug_hooks->var_location (insn);
break;
default:
@ -2038,8 +2060,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
CC_STATUS_INIT;
#endif
if (LABEL_NAME (insn))
(*debug_hooks->label) (insn);
if (!DECL_IGNORED_P (current_function_decl) && LABEL_NAME (insn))
debug_hooks->label (insn);
app_disable ();
@ -2193,13 +2215,10 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
}
/* Output this line note if it is the first or the last line
note in a row. */
if (notice_source_line (insn, &is_stmt))
{
(*debug_hooks->source_line) (last_linenum,
last_filename,
last_discriminator,
is_stmt);
}
if (!DECL_IGNORED_P (current_function_decl)
&& notice_source_line (insn, &is_stmt))
(*debug_hooks->source_line) (last_linenum, last_filename,
last_discriminator, is_stmt);
if (GET_CODE (body) == ASM_INPUT)
{
@ -4261,7 +4280,8 @@ rest_of_handle_final (void)
*will* be routed past here. */
timevar_push (TV_SYMOUT);
(*debug_hooks->function_decl) (current_function_decl);
if (!DECL_IGNORED_P (current_function_decl))
debug_hooks->function_decl (current_function_decl);
timevar_pop (TV_SYMOUT);
/* Release the blocks that are linked to DECL_INITIAL() to free the memory. */

View File

@ -2539,7 +2539,8 @@ struct GTY(()) tree_decl_minimal {
(DECL_COMMON_CHECK (NODE)->decl_common.debug_expr_is_from)
/* Nonzero for a given ..._DECL node means that the name of this node should
be ignored for symbolic debug purposes. */
be ignored for symbolic debug purposes. Moreover, for a FUNCTION_DECL,
the body of the function should also be ignored. */
#define DECL_IGNORED_P(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.ignored_flag)
/* Nonzero for a given ..._DECL node means that this node represents an

View File

@ -1749,7 +1749,8 @@ assemble_start_function (tree decl, const char *fnname)
ASM_OUTPUT_FUNCTION_PREFIX (asm_out_file, fnname);
#endif
(*debug_hooks->begin_function) (decl);
if (!DECL_IGNORED_P (decl))
(*debug_hooks->begin_function) (decl);
/* Make function name accessible from other files, if appropriate. */