* 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
+2002-06-17 Richard Henderson <rth@redhat.com>
+
+ * 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 <vmakarov@redhat.com>
* sched-ebb.c (init_ready_list): Check INSN_P first.
);
}
-/* 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)
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
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;
/* 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);
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);
= &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
{
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;
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
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);
}
}
{
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);
}
}
}
ASM_OUTPUT_POP_SECTION (asm_out_file);
-
- if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl) != NULL)
- current_funcdef_number++;
}
\f
/* Output a marker (i.e. a label) for the beginning of the generated code
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);
}
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);
}
/* 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);
}
};
static int call_site_base;
-static unsigned int sjlj_funcdef_number;
static GTY ((param_is (union tree_node)))
htab_t type_to_runtime_map;
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
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);
{
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. */
#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);
#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);
(i ? NULL : "Exception specification table"));
function_section (current_function_decl);
-
- if (USING_SJLJ_EXCEPTIONS)
- sjlj_funcdef_number += 1;
}
#include "gt-except.h"
#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
#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)
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. */
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;
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
}
/* 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. */
#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)
/* 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 *));
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);
}
}
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);
}
}
/* 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);
}
}