summaryrefslogtreecommitdiff
path: root/gcc/ira-build.c
diff options
context:
space:
mode:
authormiyuki <miyuki@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-19 04:24:31 +0000
committermiyuki <miyuki@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-19 04:24:31 +0000
commitdfcf26a50277fd64a34ddba495f10431b25bb9fa (patch)
treeeefdc0644e3d1f6b92e84e3b1ced07ac8b856fb6 /gcc/ira-build.c
parenta5a3b156b0c1f547bd2c041d35f7dd1807a21685 (diff)
downloadgcc-dfcf26a50277fd64a34ddba495f10431b25bb9fa.tar.gz
Use std::swap instead of explicit swaps
gcc/ * bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of explicit swaps. * dojump.c (do_compare_rtx_and_jump): Likewise. * expmed.c (emit_store_flag_1): Likewise. * fibonacci_heap.h (fibonacci_heap::union_with): Likewise. * final.c (sprint_ul): Use std::reverse for reversing a string. * fold-const.c (extract_muldiv_1): Use std::swap. * genmodes.c (emit_mode_int_n): Likewise. * ifcvt.c (dead_or_predicable): Likewise. * ira-build.c (ira_merge_live_ranges): Likewise. (swap_allocno_copy_ends_if_necessary): Likewise. * ira.c (ira_setup_alts): Likewise. * loop-iv.c (iv_analyze_expr): Likewise. (implies_p): Likewise. (canon_condition): Likewise. * lra-constraints.c (swap_operands): Likewise. * lra-lives.c (lra_merge_live_ranges): Likewise. * omega.c (swap): Remove. (bswap): Remove. (omega_unprotect_1): Use std::swap. (omega_solve_geq): Likewise. * optabs.c (expand_binop_directly): Likewise. (expand_binop): Likewise. (emit_conditional_move): Likewise. (emit_conditional_add): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reg-stack.c (emit_swap_insn): Likewise. (swap_to_top): Likewise. (compare_for_stack_reg): Likewise. (subst_asm_stack_regs): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (gen_reload_chain_without_interm_reg_p): Likewise. * sel-sched.c (invoke_reorder_hooks): Likewise. (create_block_for_bookkeeping): Likewise. * tree-data-ref.c (lambda_matrix_row_exchange): Remove. (lambda_matrix_right_hermite): Use std::swap. * tree-ssa-coalesce.c (sort_coalesce_list): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise. * tree-ssa-math-opts.c (is_widening_mult_p): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (linearize_expr_tree): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (compare_ranges): Likewise. * var-tracking.c (add_with_sets): Likewise. (vt_find_locations): Likewise. gcc/c/ * c-typeck.c (build_array_ref): Use std::swap instead of explicit swaps gcc/cp/ * typeck.c (composite_pointer_type): Use std::swap instead of explicit swaps. gcc/c-family/ * c-common.c (shorten_compare): Use std::swap instead of explicit swaps. gcc/fortran/ * interface.c (compare_actual_formal): Use std::swap instead of explicit swaps. * trans-array.c (gfc_trans_scalarized_loop_end): Likewise. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223332 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ira-build.c')
-rw-r--r--gcc/ira-build.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/gcc/ira-build.c b/gcc/ira-build.c
index 189f340800a..8b6b9564fcb 100644
--- a/gcc/ira-build.c
+++ b/gcc/ira-build.c
@@ -1000,7 +1000,7 @@ ira_copy_live_range_list (live_range_t r)
live_range_t
ira_merge_live_ranges (live_range_t r1, live_range_t r2)
{
- live_range_t first, last, temp;
+ live_range_t first, last;
if (r1 == NULL)
return r2;
@@ -1009,18 +1009,14 @@ ira_merge_live_ranges (live_range_t r1, live_range_t r2)
for (first = last = NULL; r1 != NULL && r2 != NULL;)
{
if (r1->start < r2->start)
- {
- temp = r1;
- r1 = r2;
- r2 = temp;
- }
+ std::swap (r1, r2);
if (r1->start <= r2->finish + 1)
{
/* Intersected ranges: merge r1 and r2 into r1. */
r1->start = r2->start;
if (r1->finish < r2->finish)
r1->finish = r2->finish;
- temp = r2;
+ live_range_t temp = r2;
r2 = r2->next;
ira_finish_live_range (temp);
if (r2 == NULL)
@@ -1479,23 +1475,12 @@ add_allocno_copy_to_list (ira_copy_t cp)
static void
swap_allocno_copy_ends_if_necessary (ira_copy_t cp)
{
- ira_allocno_t temp;
- ira_copy_t temp_cp;
-
if (ALLOCNO_NUM (cp->first) <= ALLOCNO_NUM (cp->second))
return;
- temp = cp->first;
- cp->first = cp->second;
- cp->second = temp;
-
- temp_cp = cp->prev_first_allocno_copy;
- cp->prev_first_allocno_copy = cp->prev_second_allocno_copy;
- cp->prev_second_allocno_copy = temp_cp;
-
- temp_cp = cp->next_first_allocno_copy;
- cp->next_first_allocno_copy = cp->next_second_allocno_copy;
- cp->next_second_allocno_copy = temp_cp;
+ std::swap (cp->first, cp->second);
+ std::swap (cp->prev_first_allocno_copy, cp->prev_second_allocno_copy);
+ std::swap (cp->next_first_allocno_copy, cp->next_second_allocno_copy);
}
/* Create (or update frequency if the copy already exists) and return