Commit 53bee79c by Richard Sandiford Committed by Richard Sandiford

Hide call_used_regs in target-independent code

Now that tests of call_used_regs go through call_used_or_fixed_reg_p,
we can hide call_used_regs from target-independent code.  (It still
needs to be available to targets for the conditional register usage
hooks.)

2019-09-10  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* hard-reg-set.h (call_used_regs): Only define if IN_TARGET_CODE.
	(call_used_or_fixed_reg_p): Expand definition of call_used_regs.
	* reginfo.c (call_used_regs): New macro.

From-SVN: r275604
parent 2e3d041b
2019-09-10 Richard Sandiford <richard.sandiford@arm.com> 2019-09-10 Richard Sandiford <richard.sandiford@arm.com>
* hard-reg-set.h (call_used_regs): Only define if IN_TARGET_CODE.
(call_used_or_fixed_reg_p): Expand definition of call_used_regs.
* reginfo.c (call_used_regs): New macro.
2019-09-10 Richard Sandiford <richard.sandiford@arm.com>
* config/alpha/alpha.c (alpha_compute_frame_layout): Remove redundant * config/alpha/alpha.c (alpha_compute_frame_layout): Remove redundant
fixed_regs test. fixed_regs test.
* config/bpf/bpf.c (bpf_compute_frame_layout, bpf_expand_prologue) * config/bpf/bpf.c (bpf_compute_frame_layout, bpf_expand_prologue)
......
...@@ -473,8 +473,10 @@ extern struct target_hard_regs *this_target_hard_regs; ...@@ -473,8 +473,10 @@ extern struct target_hard_regs *this_target_hard_regs;
(this_target_hard_regs->x_fixed_reg_set) (this_target_hard_regs->x_fixed_reg_set)
#define fixed_nonglobal_reg_set \ #define fixed_nonglobal_reg_set \
(this_target_hard_regs->x_fixed_nonglobal_reg_set) (this_target_hard_regs->x_fixed_nonglobal_reg_set)
#ifdef IN_TARGET_CODE
#define call_used_regs \ #define call_used_regs \
(this_target_hard_regs->x_call_used_regs) (this_target_hard_regs->x_call_used_regs)
#endif
#define call_really_used_regs \ #define call_really_used_regs \
(this_target_hard_regs->x_call_really_used_regs) (this_target_hard_regs->x_call_really_used_regs)
#define savable_regs \ #define savable_regs \
...@@ -517,7 +519,7 @@ extern const char * reg_class_names[]; ...@@ -517,7 +519,7 @@ extern const char * reg_class_names[];
inline bool inline bool
call_used_or_fixed_reg_p (unsigned int regno) call_used_or_fixed_reg_p (unsigned int regno)
{ {
return fixed_regs[regno] || call_used_regs[regno]; return fixed_regs[regno] || this_target_hard_regs->x_call_used_regs[regno];
} }
#endif /* ! GCC_HARD_REG_SET_H */ #endif /* ! GCC_HARD_REG_SET_H */
...@@ -66,6 +66,9 @@ struct target_hard_regs *this_target_hard_regs = &default_target_hard_regs; ...@@ -66,6 +66,9 @@ struct target_hard_regs *this_target_hard_regs = &default_target_hard_regs;
struct target_regs *this_target_regs = &default_target_regs; struct target_regs *this_target_regs = &default_target_regs;
#endif #endif
#define call_used_regs \
(this_target_hard_regs->x_call_used_regs)
/* Data for initializing fixed_regs. */ /* Data for initializing fixed_regs. */
static const char initial_fixed_regs[] = FIXED_REGISTERS; static const char initial_fixed_regs[] = FIXED_REGISTERS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment