diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-09-30 16:20:04 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-09-30 16:20:04 +0000 |
commit | 737d6a1a1745bdd4041e73800a842a1086967d5d (patch) | |
tree | 1347aa114cf2ffddae7f64d2e90f4d8389e1aba9 /gcc/targhooks.c | |
parent | 6ee2cc70024253d2670a4a317158b2a65251a1d1 (diff) |
Pass an ABI to choose_hard_reg_mode
choose_hard_reg_mode previously took a boolean saying whether the
mode needed to be call-preserved. This patch replaces it with an
optional ABI pointer instead, so that the function can use that
to test whether a value is call-saved.
default_dwarf_frame_reg_mode uses eh_edge_abi because that's the
ABI that matters for unwinding. Targets need to override the hook
if they want something different.
2019-09-30 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* rtl.h (predefined_function_abi): Declare.
(choose_hard_reg_mode): Take a pointer to a predefined_function_abi
instead of a boolean call_save flag.
* config/gcn/gcn.c (gcn_hard_regno_caller_save_mode): Update call
accordingly.
* config/i386/i386.h (HARD_REGNO_CALLER_SAVE_MODE): Likewise.
* config/ia64/ia64.h (HARD_REGNO_CALLER_SAVE_MODE): Likewise.
* config/mips/mips.c (mips_hard_regno_caller_save_mode): Likewise.
* config/msp430/msp430.h (HARD_REGNO_CALLER_SAVE_MODE): Likewise.
* config/rs6000/rs6000.h (HARD_REGNO_CALLER_SAVE_MODE): Likewise.
* config/sh/sh.c (sh_hard_regno_caller_save_mode): Likewise.
* reginfo.c (init_reg_modes_target): Likewise.
(choose_hard_reg_mode): Take a pointer to a predefined_function_abi
instead of a boolean call_save flag.
* targhooks.c: Include function-abi.h.
(default_dwarf_frame_reg_mode): Update call to choose_hard_reg_mode,
using eh_edge_abi to choose the mode.
From-SVN: r276312
Diffstat (limited to 'gcc/targhooks.c')
-rw-r--r-- | gcc/targhooks.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 6105137aad5..54450381378 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -83,6 +83,7 @@ along with GCC; see the file COPYING3. If not see #include "real.h" #include "langhooks.h" #include "sbitmap.h" +#include "function-abi.h" bool default_legitimate_address_p (machine_mode mode ATTRIBUTE_UNUSED, @@ -1928,8 +1929,9 @@ default_dwarf_frame_reg_mode (int regno) { machine_mode save_mode = reg_raw_mode[regno]; - if (targetm.hard_regno_call_part_clobbered (0, regno, save_mode)) - save_mode = choose_hard_reg_mode (regno, 1, true); + if (targetm.hard_regno_call_part_clobbered (eh_edge_abi.id (), + regno, save_mode)) + save_mode = choose_hard_reg_mode (regno, 1, &eh_edge_abi); return save_mode; } |