diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2016-11-18 10:04:53 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2016-11-18 10:04:53 +0000 |
commit | f079167a3064f11a7d8c17ef78389559435bad9d (patch) | |
tree | 088a5faa65bea2b992c890d73bbec5c40806cb74 /gcc/dwarf2out.c | |
parent | 899ca90e6defb9d63e03764ceb9afe0fc94fbdb1 (diff) | |
download | gcc-f079167a3064f11a7d8c17ef78389559435bad9d.zip gcc-f079167a3064f11a7d8c17ef78389559435bad9d.tar.gz gcc-f079167a3064f11a7d8c17ef78389559435bad9d.tar.bz2 |
Use rtx_mode_t instead of std::make_pair
This change makes the code less sensitive to the exact type of the mode,
i.e. it forces a conversion where necessary. This becomes important
when wrappers like scalar_int_mode and scalar_mode can also be used
instead of machine_mode.
Using rtx_mode_t also abstracts away the representation. The fact that
it's a std::pair rather than a custom class isn't important to users of
the interface.
gcc/
2016-11-18 Richard Sandiford <richard.sandiford@arm.com>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* combine.c (try_combine): Use rtx_mode_t instead of std::make_pair.
* dwarf2out.c (mem_loc_descriptor, loc_descriptor): Likewise.
(add_const_value_attribute): Likewise.
* explow.c (plus_constant): Likewise.
* expmed.c (expand_mult, make_tree): Likewise.
* expr.c (convert_modes): Likewise.
* loop-doloop.c (doloop_optimize): Likewise.
* postreload.c (reload_cse_simplify_set): Likewise.
* simplify-rtx.c (simplify_const_unary_operation): Likewise.
(simplify_binary_operation_1, simplify_const_binary_operation):
(simplify_const_relational_operation, simplify_immed_subreg): Likewise.
* wide-int.h: Update documentation to recommend rtx_mode_t
instead of std::make_pair.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r242586
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a7344ca..e468a4c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -15127,7 +15127,7 @@ mem_loc_descriptor (rtx rtl, machine_mode mode, mem_loc_result->dw_loc_oprnd2.val_class = dw_val_class_wide_int; mem_loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc<wide_int> (); - *mem_loc_result->dw_loc_oprnd2.v.val_wide = std::make_pair (rtl, mode); + *mem_loc_result->dw_loc_oprnd2.v.val_wide = rtx_mode_t (rtl, mode); } break; @@ -15670,7 +15670,7 @@ loc_descriptor (rtx rtl, machine_mode mode, GET_MODE_SIZE (mode), 0); loc_result->dw_loc_oprnd2.val_class = dw_val_class_wide_int; loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc<wide_int> (); - *loc_result->dw_loc_oprnd2.v.val_wide = std::make_pair (rtl, mode); + *loc_result->dw_loc_oprnd2.v.val_wide = rtx_mode_t (rtl, mode); } break; @@ -15695,7 +15695,7 @@ loc_descriptor (rtx rtl, machine_mode mode, for (i = 0, p = array; i < length; i++, p += elt_size) { rtx elt = CONST_VECTOR_ELT (rtl, i); - insert_wide_int (std::make_pair (elt, imode), p, elt_size); + insert_wide_int (rtx_mode_t (elt, imode), p, elt_size); } break; @@ -18357,7 +18357,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl) case CONST_WIDE_INT: { - wide_int w1 = std::make_pair (rtl, MAX_MODE_INT); + wide_int w1 = rtx_mode_t (rtl, MAX_MODE_INT); unsigned int prec = MIN (wi::min_precision (w1, UNSIGNED), (unsigned int)CONST_WIDE_INT_NUNITS (rtl) * HOST_BITS_PER_WIDE_INT); wide_int w = wi::zext (w1, prec); @@ -18404,7 +18404,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl) for (i = 0, p = array; i < length; i++, p += elt_size) { rtx elt = CONST_VECTOR_ELT (rtl, i); - insert_wide_int (std::make_pair (elt, imode), p, elt_size); + insert_wide_int (rtx_mode_t (elt, imode), p, elt_size); } break; |