diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-11-18 10:04:53 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-11-18 10:04:53 +0000 |
commit | c67875ad404ce2d86806c66a1368c1242ab05c8b (patch) | |
tree | 088a5faa65bea2b992c890d73bbec5c40806cb74 /gcc/explow.c | |
parent | adc782988dd1c6be642cc3ae897051021b43fe04 (diff) | |
download | gcc-c67875ad404ce2d86806c66a1368c1242ab05c8b.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242586 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index b65eee6e921..75af333c1c3 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -98,8 +98,7 @@ plus_constant (machine_mode mode, rtx x, HOST_WIDE_INT c, switch (code) { CASE_CONST_SCALAR_INT: - return immed_wide_int_const (wi::add (std::make_pair (x, mode), c), - mode); + return immed_wide_int_const (wi::add (rtx_mode_t (x, mode), c), mode); case MEM: /* If this is a reference to the constant pool, try replacing it with a reference to a new constant. If the resulting address isn't |