aboutsummaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2012-09-19 19:56:42 +0000
committerDehao Chen <dehao@google.com>2012-09-19 19:56:42 +0000
commit0f3def43661d3a22f9fcd8e8a19a3cb227059ee2 (patch)
treecb527556784345ff0f9931444fd4e51652a67835 /gcc/emit-rtl.c
parent60125706bc6dc359f1bb3ca01f7fb311094f322b (diff)
Integrate lexical block into source_location.
gcc: 2012-09-19 Dehao Chen <dehao@google.com> * toplev.c (general_init): Init block_locations. * tree.c (tree_set_block): New. (tree_block): Change to use LOCATION_BLOCK. * tree.h (TREE_SET_BLOCK): New. * final.c (reemit_insn_block_notes): Change to use LOCATION_BLOCK. (final_start_function): Likewise. * input.c (expand_location_1): Likewise. * input.h (LOCATION_LOCUS): New. (LOCATION_BLOCK): New. (IS_UNKNOWN_LOCATION): New. * fold-const.c (expr_location_or): Change to use new location. * reorg.c (emit_delay_sequence): Likewise. (try_merge_delay_insns): Likewise. * modulo-sched.c (dump_insn_location): Likewise. * lto-streamer-out.c (lto_output_location_bitpack): Likewise. * lto-cgraph.c (output_node_opt_summary): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * ifcvt.c (noce_try_move): Likewise. (noce_try_store_flag): Likewise. (noce_try_store_flag_constants): Likewise. (noce_try_addcc): Likewise. (noce_try_store_flag_mask): Likewise. (noce_try_cmove): Likewise. (noce_try_cmove_arith): Likewise. (noce_try_minmax): Likewise. (noce_try_abs): Likewise. (noce_try_sign_mask): Likewise. (noce_try_bitop): Likewise. (noce_process_if_block): Likewise. (cond_move_process_if_block): Likewise. (find_cond_trap): Likewise. * ipa-prop.c (ipa_set_jf_constant): Likewise. (ipa_write_jump_function): Likewise. * dwarf2out.c (add_src_coords_attributes): Likewise. * expr.c (expand_expr_real): Likewise. * tree-parloops.c (create_loop_fn): Likewise. * recog.c (peep2_attempt): Likewise. * function.c (free_after_compilation): Likewise. (expand_function_end): Likewise. (set_insn_locations): Likewise. (thread_prologue_and_epilogue_insns): Likewise. * print-rtl.c (print_rtx): Likewise. * profile.c (branch_prob): Likewise. * trans-mem.c (ipa_tm_scan_irr_block): Likewise. * gimplify.c (gimplify_call_expr): Likewise. * except.c (duplicate_eh_regions_1): Likewise. * emit-rtl.c (try_split): Likewise. (make_insn_raw): Likewise. (make_debug_insn_raw): Likewise. (make_jump_insn_raw): Likewise. (make_call_insn_raw): Likewise. (emit_pattern_after_setloc): Likewise. (emit_pattern_after): Likewise. (emit_debug_insn_after): Likewise. (emit_pattern_before): Likewise. (emit_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_call_insn_before_setloc): Likewise. (emit_call_insn_before): Likeise. (emit_debug_insn_before_setloc): Likewise. (emit_copy_of_insn_after): Likewise. (insn_locators_alloc): Remove. (insn_locators_finalize): Remove. (insn_locators_free): Remove. (set_curr_insn_source_location): Remove. (get_curr_insn_source_location): Remove. (set_curr_insn_block): Remove. (get_curr_insn_block): Remove. (locator_scope): Remove. (insn_scope): Change to use new location. (locator_location): Remove. (insn_line): Change to use new location. (locator_file): Remove. (insn_file): Change to use new location. (locator_eq): Remove. (insn_locations_init): New. (insn_locations_finalize): New. (set_curr_insn_location): New. (curr_insn_location): New. * cfgexpand.c (gimple_assign_rhs_to_tree): Change to use new location. (expand_gimple_cond): Likewise. (expand_call_stmt): Likewise. (expand_gimple_stmt_1): Likewise. (expand_gimple_basic_block): Likewise. (construct_exit_block): Likewise. (gimple_expand_cfg): Likewise. * cfgcleanup.c (try_forward_edges): Likewise. * tree-ssa-live.c (remove_unused_scope_block_p): Likewise. (dump_scope_block): Likewise. (remove_unused_locals): Likewise. * rtl.c (rtx_equal_p_cb): Likewise. (rtx_equal_p): Likewise. * rtl.h (XUINT): New. (INSN_LOCATOR): Remove. (CURR_INSN_LOCATION): Remove. (INSN_LOCATION): New. (INSN_HAS_LOCATION): New. * tree-inline.c (remap_gimple_op_r): Change to use new location. (copy_tree_body_r): Likewise. (copy_phis_for_bb): Likewise. (expand_call_inline): Likewise. * tree-streamer-in.c (lto_input_ts_exp_tree_pointers): Likewise. * tree-streamer-out.c (write_ts_decl_minimal_tree_pointers): Likewise. * gimple-streamer-out.c (output_gimple_stmt): Likewise. * combine.c (try_combine): Likewise. * tree-outof-ssa.c (set_location_for_edge): Likewise. (insert_partition_copy_on_edge): Likewise. (insert_value_copy_on_edge): Likewise. (insert_rtx_to_part_on_edge): Likewise. (insert_part_to_rtx_on_edge): Likewise. * basic-block.h (edge_def): Remove field. * gimple.h (gimple_statement_base): Remove field. (gimple_bb): Change to use new location. (gimple_set_block): Likewise. (gimple_has_location): Likewise. * tree-cfg.c (make_cond_expr_edges): Likewise. (make_goto_expr_edges): Likewise. (gimple_can_merge_blocks_p): Likewise. (move_stmt_op): Likewise. (move_block_to_fn): Likewise. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/i386/i386.c (x86_output_mi_thunk): Likewise. * config/tilegx/tilegx.c (tilegx_output_mi_thunk): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/ia64/ia64.c (ia64_output_mi_thunk): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/score/score.c (score_output_mi_thunk): Likewise. * config/tilepro/tilepro.c (tilepro_asm_output_mi_thunk): Likewise. * config/mips/mips.c (mips_output_mi_thunk): Likewise. * cfgrtl.c (unique_locus_on_edge_between_p): Likewise. (unique_locus_on_edge_between_p): Likewise. (emit_nop_for_unique_locus_between): Likewise. (force_nonfallthru_and_redirect): Likewise. (fixup_reorder_chain): Likewise. (cfg_layout_merge_blocks): Likewise. * stmt.c (emit_case_nodes): Likewise. gcc/lto: 2012-09-19 Dehao Chen <dehao@google.com> * lto/lto.c (lto_fixup_prevailing_decls): Remove tree.exp.block field. libcpp: 2012-09-19 Dehao Chen <dehao@google.com> * include/line-map.h (MAX_SOURCE_LOCATION): New value. (location_adhoc_data_fini): New. (get_combined_adhoc_loc): New. (get_data_from_adhoc_loc): New. (get_location_from_adhoc_loc): New. (location_adhoc_data_map): New. (COMBINE_LOCATION_DATA): New. (IS_ADHOC_LOC): New. (expanded_location): New field. (line_maps): New field. * line-map.c (location_adhoc_data): New. (location_adhoc_data_hash): New. (location_adhoc_data_eq): New. (location_adhoc_data_update): New. (get_combined_adhoc_loc): New. (get_data_from_adhoc_loc): New. (get_location_from_adhoc_loc): New. (location_adhoc_data_init): New. (location_adhoc_data_fini): New. (linemap_init): Initialize location_adhoc_data. (linemap_lookup): Change to use new location. (linemap_ordinary_map_lookup): Likewise. (linemap_macro_map_lookup): Likewise. (linemap_macro_map_loc_to_def_point): Likewise. (linemap_macro_map_loc_unwind_toward_spel): Likewise. (linemap_get_expansion_line): Likewise. (linemap_get_expansion_filename): Likewise. (linemap_location_in_system_header_p): Likewise. (linemap_location_from_macro_expansion_p): Likewise. (linemap_macro_loc_to_spelling_point): Likewise. (linemap_macro_loc_to_def_point): Likewise. (linemap_macro_loc_to_exp_point): Likewise. (linemap_resolve_location): Likewise. (linemap_unwind_toward_expansion): Likewise. (linemap_unwind_to_first_non_reserved_loc): Likewise. (linemap_expand_location): Likewise. (linemap_dump_location): Likewise. (linemap_line_start): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@191494 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c266
1 files changed, 41 insertions, 225 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index f7639455909..a65558d0c8e 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -3653,7 +3653,7 @@ try_split (rtx pat, rtx trial, int last)
}
}
- tem = emit_insn_after_setloc (seq, trial, INSN_LOCATOR (trial));
+ tem = emit_insn_after_setloc (seq, trial, INSN_LOCATION (trial));
delete_insn (trial);
if (has_barrier)
@@ -3689,7 +3689,7 @@ make_insn_raw (rtx pattern)
PATTERN (insn) = pattern;
INSN_CODE (insn) = -1;
REG_NOTES (insn) = NULL;
- INSN_LOCATOR (insn) = curr_insn_locator ();
+ INSN_LOCATION (insn) = curr_insn_location ();
BLOCK_FOR_INSN (insn) = NULL;
#ifdef ENABLE_RTL_CHECKING
@@ -3722,7 +3722,7 @@ make_debug_insn_raw (rtx pattern)
PATTERN (insn) = pattern;
INSN_CODE (insn) = -1;
REG_NOTES (insn) = NULL;
- INSN_LOCATOR (insn) = curr_insn_locator ();
+ INSN_LOCATION (insn) = curr_insn_location ();
BLOCK_FOR_INSN (insn) = NULL;
return insn;
@@ -3742,7 +3742,7 @@ make_jump_insn_raw (rtx pattern)
INSN_CODE (insn) = -1;
REG_NOTES (insn) = NULL;
JUMP_LABEL (insn) = NULL;
- INSN_LOCATOR (insn) = curr_insn_locator ();
+ INSN_LOCATION (insn) = curr_insn_location ();
BLOCK_FOR_INSN (insn) = NULL;
return insn;
@@ -3762,7 +3762,7 @@ make_call_insn_raw (rtx pattern)
INSN_CODE (insn) = -1;
REG_NOTES (insn) = NULL;
CALL_INSN_FUNCTION_USAGE (insn) = NULL;
- INSN_LOCATOR (insn) = curr_insn_locator ();
+ INSN_LOCATION (insn) = curr_insn_location ();
BLOCK_FOR_INSN (insn) = NULL;
return insn;
@@ -4435,8 +4435,8 @@ emit_pattern_after_setloc (rtx pattern, rtx after, int loc,
after = NEXT_INSN (after);
while (1)
{
- if (active_insn_p (after) && !INSN_LOCATOR (after))
- INSN_LOCATOR (after) = loc;
+ if (active_insn_p (after) && !INSN_LOCATION (after))
+ INSN_LOCATION (after) = loc;
if (after == last)
break;
after = NEXT_INSN (after);
@@ -4459,62 +4459,62 @@ emit_pattern_after (rtx pattern, rtx after, bool skip_debug_insns,
prev = PREV_INSN (prev);
if (INSN_P (prev))
- return emit_pattern_after_setloc (pattern, after, INSN_LOCATOR (prev),
+ return emit_pattern_after_setloc (pattern, after, INSN_LOCATION (prev),
make_raw);
else
return emit_pattern_after_noloc (pattern, after, NULL, make_raw);
}
-/* Like emit_insn_after_noloc, but set INSN_LOCATOR according to LOC. */
+/* Like emit_insn_after_noloc, but set INSN_LOCATION according to LOC. */
rtx
emit_insn_after_setloc (rtx pattern, rtx after, int loc)
{
return emit_pattern_after_setloc (pattern, after, loc, make_insn_raw);
}
-/* Like emit_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */
+/* Like emit_insn_after_noloc, but set INSN_LOCATION according to AFTER. */
rtx
emit_insn_after (rtx pattern, rtx after)
{
return emit_pattern_after (pattern, after, true, make_insn_raw);
}
-/* Like emit_jump_insn_after_noloc, but set INSN_LOCATOR according to LOC. */
+/* Like emit_jump_insn_after_noloc, but set INSN_LOCATION according to LOC. */
rtx
emit_jump_insn_after_setloc (rtx pattern, rtx after, int loc)
{
return emit_pattern_after_setloc (pattern, after, loc, make_jump_insn_raw);
}
-/* Like emit_jump_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */
+/* Like emit_jump_insn_after_noloc, but set INSN_LOCATION according to AFTER. */
rtx
emit_jump_insn_after (rtx pattern, rtx after)
{
return emit_pattern_after (pattern, after, true, make_jump_insn_raw);
}
-/* Like emit_call_insn_after_noloc, but set INSN_LOCATOR according to LOC. */
+/* Like emit_call_insn_after_noloc, but set INSN_LOCATION according to LOC. */
rtx
emit_call_insn_after_setloc (rtx pattern, rtx after, int loc)
{
return emit_pattern_after_setloc (pattern, after, loc, make_call_insn_raw);
}
-/* Like emit_call_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */
+/* Like emit_call_insn_after_noloc, but set INSN_LOCATION according to AFTER. */
rtx
emit_call_insn_after (rtx pattern, rtx after)
{
return emit_pattern_after (pattern, after, true, make_call_insn_raw);
}
-/* Like emit_debug_insn_after_noloc, but set INSN_LOCATOR according to LOC. */
+/* Like emit_debug_insn_after_noloc, but set INSN_LOCATION according to LOC. */
rtx
emit_debug_insn_after_setloc (rtx pattern, rtx after, int loc)
{
return emit_pattern_after_setloc (pattern, after, loc, make_debug_insn_raw);
}
-/* Like emit_debug_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */
+/* Like emit_debug_insn_after_noloc, but set INSN_LOCATION according to AFTER. */
rtx
emit_debug_insn_after (rtx pattern, rtx after)
{
@@ -4544,8 +4544,8 @@ emit_pattern_before_setloc (rtx pattern, rtx before, int loc, bool insnp,
first = NEXT_INSN (first);
while (1)
{
- if (active_insn_p (first) && !INSN_LOCATOR (first))
- INSN_LOCATOR (first) = loc;
+ if (active_insn_p (first) && !INSN_LOCATION (first))
+ INSN_LOCATION (first) = loc;
if (first == last)
break;
first = NEXT_INSN (first);
@@ -4569,7 +4569,7 @@ emit_pattern_before (rtx pattern, rtx before, bool skip_debug_insns,
next = PREV_INSN (next);
if (INSN_P (next))
- return emit_pattern_before_setloc (pattern, before, INSN_LOCATOR (next),
+ return emit_pattern_before_setloc (pattern, before, INSN_LOCATION (next),
insnp, make_raw);
else
return emit_pattern_before_noloc (pattern, before,
@@ -4577,7 +4577,7 @@ emit_pattern_before (rtx pattern, rtx before, bool skip_debug_insns,
NULL, make_raw);
}
-/* Like emit_insn_before_noloc, but set INSN_LOCATOR according to LOC. */
+/* Like emit_insn_before_noloc, but set INSN_LOCATION according to LOC. */
rtx
emit_insn_before_setloc (rtx pattern, rtx before, int loc)
{
@@ -4585,14 +4585,14 @@ emit_insn_before_setloc (rtx pattern, rtx before, int loc)
make_insn_raw);
}
-/* Like emit_insn_before_noloc, but set INSN_LOCATOR according to BEFORE. */
+/* Like emit_insn_before_noloc, but set INSN_LOCATION according to BEFORE. */
rtx
emit_insn_before (rtx pattern, rtx before)
{
return emit_pattern_before (pattern, before, true, true, make_insn_raw);
}
-/* like emit_insn_before_noloc, but set INSN_LOCATOR according to LOC. */
+/* like emit_insn_before_noloc, but set INSN_LOCATION according to LOC. */
rtx
emit_jump_insn_before_setloc (rtx pattern, rtx before, int loc)
{
@@ -4600,7 +4600,7 @@ emit_jump_insn_before_setloc (rtx pattern, rtx before, int loc)
make_jump_insn_raw);
}
-/* Like emit_jump_insn_before_noloc, but set INSN_LOCATOR according to BEFORE. */
+/* Like emit_jump_insn_before_noloc, but set INSN_LOCATION according to BEFORE. */
rtx
emit_jump_insn_before (rtx pattern, rtx before)
{
@@ -4608,7 +4608,7 @@ emit_jump_insn_before (rtx pattern, rtx before)
make_jump_insn_raw);
}
-/* Like emit_insn_before_noloc, but set INSN_LOCATOR according to LOC. */
+/* Like emit_insn_before_noloc, but set INSN_LOCATION according to LOC. */
rtx
emit_call_insn_before_setloc (rtx pattern, rtx before, int loc)
{
@@ -4617,7 +4617,7 @@ emit_call_insn_before_setloc (rtx pattern, rtx before, int loc)
}
/* Like emit_call_insn_before_noloc,
- but set insn_locator according to BEFORE. */
+ but set insn_location according to BEFORE. */
rtx
emit_call_insn_before (rtx pattern, rtx before)
{
@@ -4625,7 +4625,7 @@ emit_call_insn_before (rtx pattern, rtx before)
make_call_insn_raw);
}
-/* Like emit_insn_before_noloc, but set INSN_LOCATOR according to LOC. */
+/* Like emit_insn_before_noloc, but set INSN_LOCATION according to LOC. */
rtx
emit_debug_insn_before_setloc (rtx pattern, rtx before, int loc)
{
@@ -4634,7 +4634,7 @@ emit_debug_insn_before_setloc (rtx pattern, rtx before, int loc)
}
/* Like emit_debug_insn_before_noloc,
- but set insn_locator according to BEFORE. */
+ but set insn_location according to BEFORE. */
rtx
emit_debug_insn_before (rtx pattern, rtx before)
{
@@ -5881,7 +5881,7 @@ emit_copy_of_insn_after (rtx insn, rtx after)
/* Update LABEL_NUSES. */
mark_jump_label (PATTERN (new_rtx), new_rtx, 0);
- INSN_LOCATOR (new_rtx) = INSN_LOCATOR (insn);
+ INSN_LOCATION (new_rtx) = INSN_LOCATION (insn);
/* If the old insn is frame related, then so is the new one. This is
primarily needed for IA-64 unwind info which marks epilogue insns,
@@ -5916,249 +5916,65 @@ gen_hard_reg_clobber (enum machine_mode mode, unsigned int regno)
gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (mode, regno)));
}
-/* Data structures representing mapping of INSN_LOCATOR into scope blocks, line
- numbers and files. In order to be GGC friendly we need to use separate
- varrays. This also slightly improve the memory locality in binary search.
- The _locs array contains locators where the given property change. The
- block_locators_blocks contains the scope block that is used for all insn
- locator greater than corresponding block_locators_locs value and smaller
- than the following one. Similarly for the other properties. */
-static VEC(int,heap) *block_locators_locs;
-static GTY(()) VEC(tree,gc) *block_locators_blocks;
-static VEC(int,heap) *locations_locators_locs;
-DEF_VEC_A(location_t);
-DEF_VEC_ALLOC_A(location_t,heap);
-static VEC(location_t,heap) *locations_locators_vals;
-int prologue_locator;
-int epilogue_locator;
+location_t prologue_location;
+location_t epilogue_location;
/* Hold current location information and last location information, so the
datastructures are built lazily only when some instructions in given
place are needed. */
static location_t curr_location, last_location;
-static tree curr_block, last_block;
-static int curr_rtl_loc = -1;
-/* Allocate insn locator datastructure. */
+/* Allocate insn location datastructure. */
void
-insn_locators_alloc (void)
+insn_locations_init (void)
{
- prologue_locator = epilogue_locator = 0;
-
- block_locators_locs = VEC_alloc (int, heap, 32);
- block_locators_blocks = VEC_alloc (tree, gc, 32);
- locations_locators_locs = VEC_alloc (int, heap, 32);
- locations_locators_vals = VEC_alloc (location_t, heap, 32);
-
+ prologue_location = epilogue_location = 0;
curr_location = UNKNOWN_LOCATION;
last_location = UNKNOWN_LOCATION;
- curr_block = NULL;
- last_block = NULL;
- curr_rtl_loc = 0;
}
/* At the end of emit stage, clear current location. */
void
-insn_locators_finalize (void)
+insn_locations_finalize (void)
{
- if (curr_rtl_loc >= 0)
- epilogue_locator = curr_insn_locator ();
- curr_rtl_loc = -1;
-}
-
-/* Allocate insn locator datastructure. */
-void
-insn_locators_free (void)
-{
- prologue_locator = epilogue_locator = 0;
-
- VEC_free (int, heap, block_locators_locs);
- VEC_free (tree,gc, block_locators_blocks);
- VEC_free (int, heap, locations_locators_locs);
- VEC_free (location_t, heap, locations_locators_vals);
+ epilogue_location = curr_location;
+ curr_location = UNKNOWN_LOCATION;
}
/* Set current location. */
void
-set_curr_insn_source_location (location_t location)
+set_curr_insn_location (location_t location)
{
- /* IV opts calls into RTL expansion to compute costs of operations. At this
- time locators are not initialized. */
- if (curr_rtl_loc == -1)
- return;
curr_location = location;
}
/* Get current location. */
location_t
-get_curr_insn_source_location (void)
+curr_insn_location (void)
{
return curr_location;
}
-/* Set current scope block. */
-void
-set_curr_insn_block (tree b)
-{
- /* IV opts calls into RTL expansion to compute costs of operations. At this
- time locators are not initialized. */
- if (curr_rtl_loc == -1)
- return;
- if (b)
- curr_block = b;
-}
-
-/* Get current scope block. */
-tree
-get_curr_insn_block (void)
-{
- return curr_block;
-}
-
-/* Return current insn locator. */
-int
-curr_insn_locator (void)
-{
- if (curr_rtl_loc == -1 || curr_location == UNKNOWN_LOCATION)
- return 0;
- if (last_block != curr_block)
- {
- curr_rtl_loc++;
- VEC_safe_push (int, heap, block_locators_locs, curr_rtl_loc);
- VEC_safe_push (tree, gc, block_locators_blocks, curr_block);
- last_block = curr_block;
- }
- if (last_location != curr_location)
- {
- curr_rtl_loc++;
- VEC_safe_push (int, heap, locations_locators_locs, curr_rtl_loc);
- VEC_safe_push (location_t, heap, locations_locators_vals, curr_location);
- last_location = curr_location;
- }
- return curr_rtl_loc;
-}
-
-
-/* Return lexical scope block locator belongs to. */
-static tree
-locator_scope (int loc)
-{
- int max = VEC_length (int, block_locators_locs);
- int min = 0;
-
- /* When block_locators_locs was initialized, the pro- and epilogue
- insns didn't exist yet and can therefore not be found this way.
- But we know that they belong to the outer most block of the
- current function.
- Without this test, the prologue would be put inside the block of
- the first valid instruction in the function and when that first
- insn is part of an inlined function then the low_pc of that
- inlined function is messed up. Likewise for the epilogue and
- the last valid instruction. */
- if (loc == prologue_locator || loc == epilogue_locator)
- return DECL_INITIAL (cfun->decl);
-
- if (!max || !loc)
- return NULL;
- while (1)
- {
- int pos = (min + max) / 2;
- int tmp = VEC_index (int, block_locators_locs, pos);
-
- if (tmp <= loc && min != pos)
- min = pos;
- else if (tmp > loc && max != pos)
- max = pos;
- else
- {
- min = pos;
- break;
- }
- }
- return VEC_index (tree, block_locators_blocks, min);
-}
-
/* Return lexical scope block insn belongs to. */
tree
insn_scope (const_rtx insn)
{
- return locator_scope (INSN_LOCATOR (insn));
-}
-
-/* Return line number of the statement specified by the locator. */
-location_t
-locator_location (int loc)
-{
- int max = VEC_length (int, locations_locators_locs);
- int min = 0;
-
- while (1)
- {
- int pos = (min + max) / 2;
- int tmp = VEC_index (int, locations_locators_locs, pos);
-
- if (tmp <= loc && min != pos)
- min = pos;
- else if (tmp > loc && max != pos)
- max = pos;
- else
- {
- min = pos;
- break;
- }
- }
- return VEC_index (location_t, locations_locators_vals, min);
-}
-
-/* Return source line of the statement that produced this insn. */
-int
-locator_line (int loc)
-{
- expanded_location xloc;
- if (!loc)
- return 0;
- else
- xloc = expand_location (locator_location (loc));
- return xloc.line;
+ return LOCATION_BLOCK (INSN_LOCATION (insn));
}
/* Return line number of the statement that produced this insn. */
int
insn_line (const_rtx insn)
{
- return locator_line (INSN_LOCATOR (insn));
-}
-
-/* Return source file of the statement specified by LOC. */
-const char *
-locator_file (int loc)
-{
- expanded_location xloc;
- if (!loc)
- return 0;
- else
- xloc = expand_location (locator_location (loc));
- return xloc.file;
+ return LOCATION_LINE (INSN_LOCATION (insn));
}
/* Return source file of the statement that produced this insn. */
const char *
insn_file (const_rtx insn)
{
- return locator_file (INSN_LOCATOR (insn));
-}
-
-/* Return true if LOC1 and LOC2 locators have the same location and scope. */
-bool
-locator_eq (int loc1, int loc2)
-{
- if (loc1 == loc2)
- return true;
- if (locator_location (loc1) != locator_location (loc2))
- return false;
- return locator_scope (loc1) == locator_scope (loc2);
+ return LOCATION_FILE (INSN_LOCATION (insn));
}
-
/* Return true if memory model MODEL requires a pre-operation (release-style)
barrier or a post-operation (acquire-style) barrier. While not universal,