aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2012-07-24 17:36:56 +0000
committerRichard Henderson <rth@redhat.com>2012-07-24 17:36:56 +0000
commit56ab4930ac4c50d0928a6a753c2e6b3eee995a7f (patch)
tree915b8b77cea8c62c51c2089f3804fe1591603acd /gcc/optabs.h
parent999d4ec15aa2bd7b16760f263caf918e6f13a8e7 (diff)
Introduce and use code_to_optab and optab_to_code functions
Removes all the direct uses of op->code so that we can change the representation of "optab". The code_to_optab change is simply for uniformity (and better type checking). * optabs.h (struct optab_d): Rename code member to code_. (struct convert_optab_h): Likewise. (code_to_optab_): Rename from code_to_optab. (code_to_optab, optab_to_code): New. * dojump.c (do_compare_rtx_and_jump): Use code_to_optab. * ifcvt.c (noce_emit_move_insn): Likewise. * optabs.c (simplify_expand_binop): Use optab_to_code. (expand_simple_binop, shift_optab_p, commutative_optab_p): Likewise. (avoid_expensive_constant, expand_binop_directly): Likewise. (expand_binop, expand_simple_unop, expand_unop_direct): Likewise. (expand_unop, prepare_float_lib_cmp, expand_fixed_convert): Likewise. (have_insn_for, debug_optab_libfuncs): Likewise. (init_optab, init_optabv, init_convert_optab): Update for optab member name change. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@189818 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.h')
-rw-r--r--gcc/optabs.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/optabs.h b/gcc/optabs.h
index c502766d9e8..60f83cff8a5 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -50,7 +50,7 @@ struct widening_optab_handlers
struct optab_d
{
- enum rtx_code code;
+ enum rtx_code code_;
char libcall_suffix;
const char *libcall_basename;
void (*libcall_gen)(struct optab_d *, const char *name, char suffix,
@@ -65,7 +65,7 @@ typedef struct optab_d * optab;
is the source mode. */
struct convert_optab_d
{
- enum rtx_code code;
+ enum rtx_code code_;
const char *libcall_basename;
void (*libcall_gen)(struct convert_optab_d *, const char *name,
enum machine_mode,
@@ -671,7 +671,15 @@ enum convert_optab_index
#define vcondu_optab (&convert_optab_table[(int) COI_vcondu])
/* Contains the optab used for each rtx code. */
-extern optab code_to_optab[NUM_RTX_CODE + 1];
+extern optab code_to_optab_[NUM_RTX_CODE + 1];
+
+static inline optab
+code_to_optab (enum rtx_code code)
+{
+ return code_to_optab_[code];
+}
+
+#define optab_to_code(op) ((op)->code_)
typedef rtx (*rtxfun) (rtx);