Commit 725730f2 by Eric Botcazou

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
parent 75152bcb
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. * dbgcnt.c (dbg_cnt_process_single_pair): constify.
* opts.c (common_handle_option): constify. * opts.c (common_handle_option): constify.
......
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
putc ('.', FILE); \ putc ('.', FILE); \
RS6000_OUTPUT_BASENAME (FILE, buffer); \ RS6000_OUTPUT_BASENAME (FILE, buffer); \
fputs (":\n", FILE); \ fputs (":\n", FILE); \
if (write_symbols != NO_DEBUG) \ if (write_symbols != NO_DEBUG && !DECL_IGNORED_P (DECL)) \
xcoffout_declare_function (FILE, DECL, buffer); \ xcoffout_declare_function (FILE, DECL, buffer); \
} }
......
...@@ -902,7 +902,7 @@ dbxout_finish_complex_stabs (tree sym, stab_code_type code, ...@@ -902,7 +902,7 @@ dbxout_finish_complex_stabs (tree sym, stab_code_type code,
#if defined (DBX_DEBUGGING_INFO) #if defined (DBX_DEBUGGING_INFO)
static void static void
dbxout_function_end (tree decl) dbxout_function_end (tree decl ATTRIBUTE_UNUSED)
{ {
char lscope_label_name[100]; char lscope_label_name[100];
...@@ -921,8 +921,7 @@ dbxout_function_end (tree decl) ...@@ -921,8 +921,7 @@ dbxout_function_end (tree decl)
named sections. */ named sections. */
if (!use_gnu_debug_info_extensions if (!use_gnu_debug_info_extensions
|| NO_DBX_FUNCTION_END || NO_DBX_FUNCTION_END
|| !targetm.have_named_sections || !targetm.have_named_sections)
|| DECL_IGNORED_P (decl))
return; return;
/* By convention, GCC will mark the end of a function with an N_FUN /* By convention, GCC will mark the end of a function with an N_FUN
...@@ -3683,9 +3682,6 @@ dbxout_begin_function (tree decl) ...@@ -3683,9 +3682,6 @@ dbxout_begin_function (tree decl)
{ {
int saved_tree_used1; int saved_tree_used1;
if (DECL_IGNORED_P (decl))
return;
saved_tree_used1 = TREE_USED (decl); saved_tree_used1 = TREE_USED (decl);
TREE_USED (decl) = 1; TREE_USED (decl) = 1;
if (DECL_NAME (DECL_RESULT (decl)) != 0) if (DECL_NAME (DECL_RESULT (decl)) != 0)
......
...@@ -1484,6 +1484,20 @@ remap_debug_filename (const char *filename) ...@@ -1484,6 +1484,20 @@ remap_debug_filename (const char *filename)
return ggc_strdup (s); 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, /* Output assembler code for the start of a function,
and initialize some of the variables in this file and initialize some of the variables in this file
for the new function. The label for the function and associated for the new function. The label for the function and associated
...@@ -1508,10 +1522,11 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file, ...@@ -1508,10 +1522,11 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file,
high_block_linenum = high_function_linenum = last_linenum; 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 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); dwarf2out_begin_prologue (0, NULL);
#endif #endif
...@@ -1648,17 +1663,19 @@ final_end_function (void) ...@@ -1648,17 +1663,19 @@ final_end_function (void)
{ {
app_disable (); 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: /* Finally, output the function epilogue:
code to restore the stack frame and return to the caller. */ code to restore the stack frame and return to the caller. */
targetm.asm_out.function_epilogue (asm_out_file, get_frame_size ()); targetm.asm_out.function_epilogue (asm_out_file, get_frame_size ());
/* And debug output. */ /* 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 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_do_frame ())
dwarf2out_end_epilogue (last_linenum, last_filename); dwarf2out_end_epilogue (last_linenum, last_filename);
#endif #endif
...@@ -1839,7 +1856,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -1839,7 +1856,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
dwarf2out_switch_text_section (); dwarf2out_switch_text_section ();
else else
#endif #endif
(*debug_hooks->switch_text_section) (); if (!DECL_IGNORED_P (current_function_decl))
debug_hooks->switch_text_section ();
switch_to_section (current_function_section ()); switch_to_section (current_function_section ());
break; break;
...@@ -1905,7 +1923,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -1905,7 +1923,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
case NOTE_INSN_FUNCTION_BEG: case NOTE_INSN_FUNCTION_BEG:
app_disable (); 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) if ((*seen & (SEEN_EMITTED | SEEN_NOTE)) == SEEN_NOTE)
{ {
...@@ -1931,7 +1950,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -1931,7 +1950,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
high_block_linenum = last_linenum; high_block_linenum = last_linenum;
/* Output debugging info about the symbol-block beginning. */ /* 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. */ /* Mark this block as output. */
TREE_ASM_WRITTEN (NOTE_BLOCK (insn)) = 1; TREE_ASM_WRITTEN (NOTE_BLOCK (insn)) = 1;
...@@ -1965,7 +1985,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -1965,7 +1985,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
--block_depth; --block_depth;
gcc_assert (block_depth >= 0); 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 if (write_symbols == DBX_DEBUG
|| write_symbols == SDB_DEBUG) || write_symbols == SDB_DEBUG)
...@@ -1995,7 +2016,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -1995,7 +2016,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
break; break;
case NOTE_INSN_VAR_LOCATION: case NOTE_INSN_VAR_LOCATION:
(*debug_hooks->var_location) (insn); if (!DECL_IGNORED_P (current_function_decl))
debug_hooks->var_location (insn);
break; break;
default: default:
...@@ -2038,8 +2060,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -2038,8 +2060,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
CC_STATUS_INIT; CC_STATUS_INIT;
#endif #endif
if (LABEL_NAME (insn)) if (!DECL_IGNORED_P (current_function_decl) && LABEL_NAME (insn))
(*debug_hooks->label) (insn); debug_hooks->label (insn);
app_disable (); app_disable ();
...@@ -2193,13 +2215,10 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -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 /* Output this line note if it is the first or the last line
note in a row. */ note in a row. */
if (notice_source_line (insn, &is_stmt)) if (!DECL_IGNORED_P (current_function_decl)
{ && notice_source_line (insn, &is_stmt))
(*debug_hooks->source_line) (last_linenum, (*debug_hooks->source_line) (last_linenum, last_filename,
last_filename, last_discriminator, is_stmt);
last_discriminator,
is_stmt);
}
if (GET_CODE (body) == ASM_INPUT) if (GET_CODE (body) == ASM_INPUT)
{ {
...@@ -4261,7 +4280,8 @@ rest_of_handle_final (void) ...@@ -4261,7 +4280,8 @@ rest_of_handle_final (void)
*will* be routed past here. */ *will* be routed past here. */
timevar_push (TV_SYMOUT); 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); timevar_pop (TV_SYMOUT);
/* Release the blocks that are linked to DECL_INITIAL() to free the memory. */ /* Release the blocks that are linked to DECL_INITIAL() to free the memory. */
......
...@@ -2539,7 +2539,8 @@ struct GTY(()) tree_decl_minimal { ...@@ -2539,7 +2539,8 @@ struct GTY(()) tree_decl_minimal {
(DECL_COMMON_CHECK (NODE)->decl_common.debug_expr_is_from) (DECL_COMMON_CHECK (NODE)->decl_common.debug_expr_is_from)
/* Nonzero for a given ..._DECL node means that the name of this node should /* 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) #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 /* Nonzero for a given ..._DECL node means that this node represents an
......
...@@ -1749,7 +1749,8 @@ assemble_start_function (tree decl, const char *fnname) ...@@ -1749,7 +1749,8 @@ assemble_start_function (tree decl, const char *fnname)
ASM_OUTPUT_FUNCTION_PREFIX (asm_out_file, fnname); ASM_OUTPUT_FUNCTION_PREFIX (asm_out_file, fnname);
#endif #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. */ /* Make function name accessible from other files, if appropriate. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment