From: Richard Henderson Date: Mon, 17 Jun 2002 17:47:22 +0000 (-0700) Subject: function.h (struct function): Rename profile_label_no. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=df696a75734ea7998d0d5ef75cbafba8be33c908;p=gcc.git function.h (struct function): Rename profile_label_no. * function.h (struct function) [funcdef_no]: Rename profile_label_no. (current_function_funcdef_no): Similarly. * function.c (funcdef_no): Similarly. (prepare_function_start): Set current_function_funcdef_no. (expand_function_start): Don't set current_function_profile_label_no. * dwarf2out.h (current_funcdef_number): Remove. * dwarf2out.c (current_funcdef_number): Remove. Replace with current_function_funcdef_no throughout. * dwarfout.c, vmsdbgout.c: Similarly. * except.c (sjlj_funcdef_number): Remove. (sjlj_emit_function_enter): Use current_function_funcdef_no instead. (output_function_exception_table): Likewise. * final.c (profile_function): Use current_function_funcdef_no instead of current_function_profile_label_no. From-SVN: r54709 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ba48e50b319..094dc639a72 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2002-06-17 Richard Henderson + + * function.h (struct function) [funcdef_no]: Rename profile_label_no. + (current_function_funcdef_no): Similarly. + * function.c (funcdef_no): Similarly. + (prepare_function_start): Set current_function_funcdef_no. + (expand_function_start): Don't set current_function_profile_label_no. + * dwarf2out.h (current_funcdef_number): Remove. + * dwarf2out.c (current_funcdef_number): Remove. Replace with + current_function_funcdef_no throughout. + * dwarfout.c, vmsdbgout.c: Similarly. + * except.c (sjlj_funcdef_number): Remove. + (sjlj_emit_function_enter): Use current_function_funcdef_no instead. + (output_function_exception_table): Likewise. + * final.c (profile_function): Use current_function_funcdef_no + instead of current_function_profile_label_no. + 2002-06-17 Vladimir Makarov * sched-ebb.c (init_ready_list): Check INSN_P first. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 18a17e0f4a2..744f7eee6ba 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -103,13 +103,6 @@ dwarf2out_do_frame () ); } -/* The number of the current function definition for which debugging - information is being generated. These numbers range from 1 up to the - maximum number of function definitions contained within the current - compilation unit. These numbers are used to create unique label id's - unique to each function definition. */ -unsigned current_funcdef_number = 0; - /* The size of the target's pointer type. */ #ifndef PTR_SIZE #define PTR_SIZE (POINTER_SIZE / BITS_PER_UNIT) @@ -2115,12 +2108,11 @@ dwarf2out_begin_prologue (line, file) return; #endif - current_funcdef_number++; function_section (current_function_decl); ASM_GENERATE_INTERNAL_LABEL (label, FUNC_BEGIN_LABEL, - current_funcdef_number); + current_function_funcdef_no); ASM_OUTPUT_DEBUG_LABEL (asm_out_file, FUNC_BEGIN_LABEL, - current_funcdef_number); + current_function_funcdef_no); current_function_func_begin_label = get_identifier (label); #ifdef IA64_UNWIND_INFO @@ -2147,7 +2139,7 @@ dwarf2out_begin_prologue (line, file) fde->dw_fde_current_label = NULL; fde->dw_fde_end = NULL; fde->dw_fde_cfi = NULL; - fde->funcdef_number = current_funcdef_number; + fde->funcdef_number = current_function_funcdef_no; fde->nothrow = current_function_nothrow; fde->uses_eh_lsda = cfun->uses_eh_lsda; @@ -2173,7 +2165,8 @@ dwarf2out_end_epilogue () /* Output a label to mark the endpoint of the code generated for this function. */ - ASM_GENERATE_INTERNAL_LABEL (label, FUNC_END_LABEL, current_funcdef_number); + ASM_GENERATE_INTERNAL_LABEL (label, FUNC_END_LABEL, + current_function_funcdef_no); ASM_OUTPUT_LABEL (asm_out_file, label); fde = &fde_table[fde_table_in_use - 1]; fde->dw_fde_end = xstrdup (label); @@ -10343,10 +10336,10 @@ gen_subprogram_die (decl, context_die) equate_decl_number_to_die (decl, subr_die); ASM_GENERATE_INTERNAL_LABEL (label_id, FUNC_BEGIN_LABEL, - current_funcdef_number); + current_function_funcdef_no); add_AT_lbl_id (subr_die, DW_AT_low_pc, label_id); ASM_GENERATE_INTERNAL_LABEL (label_id, FUNC_END_LABEL, - current_funcdef_number); + current_function_funcdef_no); add_AT_lbl_id (subr_die, DW_AT_high_pc, label_id); add_pubname (decl, subr_die); @@ -11904,7 +11897,7 @@ dwarf2out_source_line (line, filename) = &separate_line_info_table[separate_line_info_table_in_use++]; line_info->dw_file_num = lookup_filename (filename); line_info->dw_line_num = line; - line_info->function = current_funcdef_number; + line_info->function = current_function_funcdef_no; } else { diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h index 5c6200cc483..63cedeadddc 100644 --- a/gcc/dwarf2out.h +++ b/gcc/dwarf2out.h @@ -26,5 +26,3 @@ struct die_struct; extern void debug_dwarf_die PARAMS ((struct die_struct *)); extern void dwarf2out_set_demangle_name_func PARAMS ((const char *(*) (const char *))); extern void dwarf2out_add_library_unit_info PARAMS ((const char *, const char *)); - -extern unsigned current_funcdef_number; diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c index b63e16c4cb4..9dcf6a8cde7 100644 --- a/gcc/dwarfout.c +++ b/gcc/dwarfout.c @@ -756,14 +756,6 @@ static unsigned incomplete_types; static tree fake_containing_scope; -/* The number of the current function definition that we are generating - debugging information for. These numbers range from 1 up to the maximum - number of function definitions contained within the current compilation - unit. These numbers are used to create unique labels for various things - contained within various function definitions. */ - -static unsigned current_funcdef_number = 1; - /* A pointer to the ..._DECL node which we have most recently been working on. We keep this around just in case something about it looks screwy and we want to tell the user what the source coordinates for the actual @@ -3894,13 +3886,14 @@ output_global_subroutine_die (arg) char label[MAX_ARTIFICIAL_LABEL_BYTES]; low_pc_attribute (function_start_label (decl)); - sprintf (label, FUNC_END_LABEL_FMT, current_funcdef_number); + sprintf (label, FUNC_END_LABEL_FMT, current_function_funcdef_no); high_pc_attribute (label); if (use_gnu_debug_info_extensions) { - sprintf (label, BODY_BEGIN_LABEL_FMT, current_funcdef_number); + sprintf (label, BODY_BEGIN_LABEL_FMT, + current_function_funcdef_no); body_begin_attribute (label); - sprintf (label, BODY_END_LABEL_FMT, current_funcdef_number); + sprintf (label, BODY_END_LABEL_FMT, current_function_funcdef_no); body_end_attribute (label); } } @@ -4275,13 +4268,14 @@ output_local_subroutine_die (arg) { char label[MAX_ARTIFICIAL_LABEL_BYTES]; low_pc_attribute (function_start_label (decl)); - sprintf (label, FUNC_END_LABEL_FMT, current_funcdef_number); + sprintf (label, FUNC_END_LABEL_FMT, current_function_funcdef_no); high_pc_attribute (label); if (use_gnu_debug_info_extensions) { - sprintf (label, BODY_BEGIN_LABEL_FMT, current_funcdef_number); + sprintf (label, BODY_BEGIN_LABEL_FMT, + current_function_funcdef_no); body_begin_attribute (label); - sprintf (label, BODY_END_LABEL_FMT, current_funcdef_number); + sprintf (label, BODY_END_LABEL_FMT, current_function_funcdef_no); body_end_attribute (label); } } @@ -5809,9 +5803,6 @@ dwarfout_file_scope_decl (decl, set_finalizing) } ASM_OUTPUT_POP_SECTION (asm_out_file); - - if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl) != NULL) - current_funcdef_number++; } /* Output a marker (i.e. a label) for the beginning of the generated code @@ -5858,7 +5849,7 @@ dwarfout_end_prologue (line) return; function_section (current_function_decl); - sprintf (label, BODY_BEGIN_LABEL_FMT, current_funcdef_number); + sprintf (label, BODY_BEGIN_LABEL_FMT, current_function_funcdef_no); ASM_OUTPUT_LABEL (asm_out_file, label); } @@ -5874,7 +5865,7 @@ dwarfout_end_function (line) if (! use_gnu_debug_info_extensions) return; function_section (current_function_decl); - sprintf (label, BODY_END_LABEL_FMT, current_funcdef_number); + sprintf (label, BODY_END_LABEL_FMT, current_function_funcdef_no); ASM_OUTPUT_LABEL (asm_out_file, label); } @@ -5890,7 +5881,7 @@ dwarfout_end_epilogue () /* Output a label to mark the endpoint of the code generated for this function. */ - sprintf (label, FUNC_END_LABEL_FMT, current_funcdef_number); + sprintf (label, FUNC_END_LABEL_FMT, current_function_funcdef_no); ASM_OUTPUT_LABEL (asm_out_file, label); } diff --git a/gcc/except.c b/gcc/except.c index fd3a87f856a..65ba6c5ac50 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -107,7 +107,6 @@ struct ehl_map_entry GTY(()) }; static int call_site_base; -static unsigned int sjlj_funcdef_number; static GTY ((param_is (union tree_node))) htab_t type_to_runtime_map; @@ -2093,7 +2092,7 @@ sjlj_emit_function_enter (dispatch_label) if (cfun->uses_eh_lsda) { char buf[20]; - ASM_GENERATE_INTERNAL_LABEL (buf, "LLSDA", sjlj_funcdef_number); + ASM_GENERATE_INTERNAL_LABEL (buf, "LLSDA", current_function_funcdef_no); emit_move_insn (mem, gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf))); } else @@ -3576,17 +3575,12 @@ output_function_exception_table () int call_site_len; #endif int have_tt_data; - int funcdef_number; int tt_format_size = 0; /* Not all functions need anything. */ if (! cfun->uses_eh_lsda) return; - funcdef_number = (USING_SJLJ_EXCEPTIONS - ? sjlj_funcdef_number - : current_funcdef_number); - #ifdef IA64_UNWIND_INFO fputs ("\t.personality\t", asm_out_file); output_addr_const (asm_out_file, eh_personality_libfunc); @@ -3607,14 +3601,16 @@ output_function_exception_table () { tt_format = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0, /*global=*/1); #ifdef HAVE_AS_LEB128 - ASM_GENERATE_INTERNAL_LABEL (ttype_label, "LLSDATT", funcdef_number); + ASM_GENERATE_INTERNAL_LABEL (ttype_label, "LLSDATT", + current_function_funcdef_no); #endif tt_format_size = size_of_encoded_value (tt_format); assemble_align (tt_format_size * BITS_PER_UNIT); } - ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LLSDA", funcdef_number); + ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LLSDA", + current_function_funcdef_no); /* The LSDA header. */ @@ -3646,7 +3642,7 @@ output_function_exception_table () #ifdef HAVE_AS_LEB128 char ttype_after_disp_label[32]; ASM_GENERATE_INTERNAL_LABEL (ttype_after_disp_label, "LLSDATTD", - funcdef_number); + current_function_funcdef_no); dw2_asm_output_delta_uleb128 (ttype_label, ttype_after_disp_label, "@TType base offset"); ASM_OUTPUT_LABEL (asm_out_file, ttype_after_disp_label); @@ -3692,9 +3688,9 @@ output_function_exception_table () #ifdef HAVE_AS_LEB128 ASM_GENERATE_INTERNAL_LABEL (cs_after_size_label, "LLSDACSB", - funcdef_number); + current_function_funcdef_no); ASM_GENERATE_INTERNAL_LABEL (cs_end_label, "LLSDACSE", - funcdef_number); + current_function_funcdef_no); dw2_asm_output_delta_uleb128 (cs_end_label, cs_after_size_label, "Call-site table length"); ASM_OUTPUT_LABEL (asm_out_file, cs_after_size_label); @@ -3751,9 +3747,6 @@ output_function_exception_table () (i ? NULL : "Exception specification table")); function_section (current_function_decl); - - if (USING_SJLJ_EXCEPTIONS) - sjlj_funcdef_number += 1; } #include "gt-except.h" diff --git a/gcc/final.c b/gcc/final.c index aa4caf19eb7..3b3dfcd68b2 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1724,7 +1724,7 @@ profile_function (file) #ifndef NO_PROFILE_COUNTERS data_section (); ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT)); - ASM_OUTPUT_INTERNAL_LABEL (file, "LP", current_function_profile_label_no); + ASM_OUTPUT_INTERNAL_LABEL (file, "LP", current_function_funcdef_no); assemble_integer (const0_rtx, LONG_TYPE_SIZE / BITS_PER_UNIT, align, 1); #endif @@ -1754,7 +1754,7 @@ profile_function (file) #endif #endif - FUNCTION_PROFILER (file, current_function_profile_label_no); + FUNCTION_PROFILER (file, current_function_funcdef_no); #if defined(STATIC_CHAIN_INCOMING_REGNUM) && defined(ASM_OUTPUT_REG_PUSH) if (cxt) diff --git a/gcc/function.c b/gcc/function.c index 8c0c6c58549..4a963dc5fae 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -124,8 +124,8 @@ int current_function_uses_only_leaf_regs; post-instantiation libcalls. */ int virtuals_instantiated; -/* Assign unique numbers to labels generated for profiling. */ -static int profile_label_no; +/* Assign unique numbers to labels generated for profiling, debugging, etc. */ +static int funcdef_no; /* These variables hold pointers to functions to create and destroy target specific, per-function data structures. */ @@ -6292,6 +6292,8 @@ prepare_function_start () current_function_outgoing_args_size = 0; + current_function_funcdef_no = funcdef_no++; + cfun->arc_profile = profile_arc_flag || flag_test_coverage; cfun->arc_profile = profile_arc_flag || flag_test_coverage; @@ -6669,9 +6671,8 @@ expand_function_start (subr, parms_have_cleanups) if (current_function_profile) { - current_function_profile_label_no = profile_label_no++; #ifdef PROFILE_HOOK - PROFILE_HOOK (current_function_profile_label_no); + PROFILE_HOOK (current_function_funcdef_no); #endif } diff --git a/gcc/function.h b/gcc/function.h index 0c598be18de..1c6337c9176 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -365,8 +365,8 @@ struct function GTY(()) /* Highest label number in current function. */ int inl_max_label_num; - /* Profile label number. */ - int profile_label_no; + /* Function sequence number for profiling, debugging, etc. */ + int funcdef_no; /* For md files. */ @@ -528,7 +528,7 @@ extern int virtuals_instantiated; #define current_function_return_rtx (cfun->return_rtx) #define current_function_instrument_entry_exit (cfun->instrument_entry_exit) #define current_function_profile (cfun->profile) -#define current_function_profile_label_no (cfun->profile_label_no) +#define current_function_funcdef_no (cfun->funcdef_no) #define current_function_limit_stack (cfun->limit_stack) #define current_function_uses_pic_offset_table (cfun->uses_pic_offset_table) #define current_function_uses_const_pool (cfun->uses_const_pool) diff --git a/gcc/vmsdbgout.c b/gcc/vmsdbgout.c index 5d19c458f45..68e0bb8cea7 100644 --- a/gcc/vmsdbgout.c +++ b/gcc/vmsdbgout.c @@ -123,13 +123,6 @@ static unsigned int line_info_table_in_use; /* Size (in elements) of increments by which we may expand line_info_table. */ #define LINE_INFO_TABLE_INCREMENT 1024 -/* The number of the current function definition for which debugging - information is being generated. These numbers range from 1 up to the - maximum number of function definitions contained within the current - compilation unit. These numbers are used to create unique label id's unique - to each function definition. */ -static unsigned int current_funcdef_number = 0; - /* Forward declarations for functions defined in this file. */ static char *full_name PARAMS ((const char *)); static unsigned int lookup_filename PARAMS ((const char *)); @@ -1290,9 +1283,8 @@ vmsdbgout_begin_prologue (line, file) if (debug_info_level > DINFO_LEVEL_NONE) { - current_funcdef_number++; ASM_GENERATE_INTERNAL_LABEL (label, FUNC_BEGIN_LABEL, - current_funcdef_number); + current_function_funcdef_no); ASM_OUTPUT_LABEL (asm_out_file, label); } } @@ -1308,7 +1300,7 @@ vmsdbgout_after_prologue () if (debug_info_level > DINFO_LEVEL_TERSE) { ASM_GENERATE_INTERNAL_LABEL (label, FUNC_PROLOG_LABEL, - current_funcdef_number); + current_function_funcdef_no); ASM_OUTPUT_LABEL (asm_out_file, label); } } @@ -1330,7 +1322,7 @@ vmsdbgout_end_epilogue () /* Output a label to mark the endpoint of the code generated for this function. */ ASM_GENERATE_INTERNAL_LABEL (label, FUNC_END_LABEL, - current_funcdef_number); + current_function_funcdef_no); ASM_OUTPUT_LABEL (asm_out_file, label); } }