From ec9ac2bc429d48bfd2466d56ddea4244ebfba990 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 24 Apr 2007 00:05:57 +0000 Subject: Revert: 2007-04-23 Jan Hubicka * function.c (init_function_start): Don't init line number info. (expand_function_end): Update. (reset_block_changes, record_block_change, finalize_block_changes, check_block_change, free_block_changes): Kill. * function.h (reset_block_changes, record_block_change, finalize_block_changes, check_block_change, free_block_changes): Remove prototypes. (struct function): Remove ib_boundaries_block. * emit-rtl.c (make_insn_raw, make_jump_insn_raw, make_call_insn_raw): Use curr_insn_locator to initialize locator. (emit_line_note): Remove. * cfgexpand.c (expand_gimple_cond_expr): Update. (construct_exit_block): Likewise. (tree_expand_cfg): Initialize/finalize locators. * expr.c (expand_expr_real): Update. * cfglayout.c (line_locators_locs, line_locators_lines, file_locators_locs, file_locators_files): Remove. (set_block_levels): Move to cfgexpand.c. (insn_locators_initialize): Remove. (pass_insn_locators_initialize): Remove. (locations_locators_locs, locations_locators_vals): New static vars. (curr_location, last_location, curr_block, last_block, curr_rtl_loc): Likewise. (insn_locators_alloc, insn_locators_finalize, set_curr_insn_source_location, set_curr_insn_block, curr_insn_locator): New functions. (locator_location): New. (locator_line, locator_file): Rewrite. * rtl.h (emit_line_note): Kill. (insn_locators_alloc, insn_locators_finalize, set_curr_insn_source_location, set_curr_insn_block, curr_insn_locator): Declare. * tree-inline.c (initialize_cfun): Do not initialize ib_boundaries_block. * passes.c (pass_insn_locators_initialize): Remove. From-SVN: r124094 --- gcc/emit-rtl.c | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) (limited to 'gcc/emit-rtl.c') diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index e816026..16fa6c5 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -3336,7 +3336,7 @@ make_insn_raw (rtx pattern) INSN_CODE (insn) = -1; LOG_LINKS (insn) = NULL; REG_NOTES (insn) = NULL; - INSN_LOCATOR (insn) = curr_insn_locator (); + INSN_LOCATOR (insn) = 0; BLOCK_FOR_INSN (insn) = NULL; #ifdef ENABLE_RTL_CHECKING @@ -3369,7 +3369,7 @@ make_jump_insn_raw (rtx pattern) LOG_LINKS (insn) = NULL; REG_NOTES (insn) = NULL; JUMP_LABEL (insn) = NULL; - INSN_LOCATOR (insn) = curr_insn_locator (); + INSN_LOCATOR (insn) = 0; BLOCK_FOR_INSN (insn) = NULL; return insn; @@ -3390,7 +3390,7 @@ make_call_insn_raw (rtx pattern) LOG_LINKS (insn) = NULL; REG_NOTES (insn) = NULL; CALL_INSN_FUNCTION_USAGE (insn) = NULL; - INSN_LOCATOR (insn) = curr_insn_locator (); + INSN_LOCATOR (insn) = 0; BLOCK_FOR_INSN (insn) = NULL; return insn; @@ -4460,6 +4460,42 @@ emit_barrier (void) return barrier; } +/* Make line numbering NOTE insn for LOCATION add it to the end + of the doubly-linked list, but only if line-numbers are desired for + debugging info and it doesn't match the previous one. */ + +rtx +emit_line_note (location_t location) +{ + rtx note; + +#ifdef USE_MAPPED_LOCATION + if (location == last_location) + return NULL_RTX; +#else + if (location.file && last_location.file + && !strcmp (location.file, last_location.file) + && location.line == last_location.line) + return NULL_RTX; +#endif + last_location = location; + + if (no_line_numbers) + { + cur_insn_uid++; + return NULL_RTX; + } + +#ifdef USE_MAPPED_LOCATION + note = emit_note ((int) location); +#else + note = emit_note (location.line); + NOTE_SOURCE_FILE (note) = location.file; +#endif + + return note; +} + /* Emit a copy of note ORIG. */ rtx -- cgit v1.1