From e5a557ac01a775df64ae8149c5fe7d503f46a92f Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 12 Apr 2019 18:39:01 +0200 Subject: [PATCH] S12Z: opcodes: Replace "operator" with "optr". opcodes/ * s12z-dis.c, s12z-opc.c, s12z-opc.h: Replace operator with optr. --- opcodes/ChangeLog | 5 +++++ opcodes/s12z-dis.c | 2 +- opcodes/s12z-opc.c | 52 +++++++++++++++++++++++----------------------- opcodes/s12z-opc.h | 4 ++-- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index a04c4defb46..043e9fe1e66 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2019-04-12 John Darrington + + s12z-dis.c, s12z-opc.c, s12z-opc.h: Replace "operator" with + "optr". ("operator" is a reserved word in c++). + 2019-04-11 Sudakshina Das * aarch64-opc.c (aarch64_print_operand): Add case for diff --git a/opcodes/s12z-dis.c b/opcodes/s12z-dis.c index d4d5fd7217f..6086f1635da 100644 --- a/opcodes/s12z-dis.c +++ b/opcodes/s12z-dis.c @@ -331,7 +331,7 @@ int print_insn_s12z (bfd_vma memaddr, struct disassemble_info* info) { int o; - enum operator operator = OP_INVALID; + enum optr operator = OP_INVALID; int n_operands = 0; /* The longest instruction in S12Z can have 6 operands. diff --git a/opcodes/s12z-opc.c b/opcodes/s12z-opc.c index 36509b58dcd..1f02f5dc6a4 100644 --- a/opcodes/s12z-opc.c +++ b/opcodes/s12z-opc.c @@ -36,8 +36,8 @@ typedef int (* insn_bytes_f) (struct mem_read_abstraction_base *); typedef void (*operands_f) (struct mem_read_abstraction_base *, int *n_operands, struct operand **operand); -typedef enum operator (*discriminator_f) (struct mem_read_abstraction_base *, - enum operator hint); +typedef enum optr (*discriminator_f) (struct mem_read_abstraction_base *, + enum optr hint); enum OPR_MODE { @@ -969,12 +969,12 @@ static void bit_field_decode (struct mem_read_abstraction_base *mra, int *n_oper static void exg_sex_decode (struct mem_read_abstraction_base *mra, int *n_operands, struct operand **operands); -static enum operator shift_discrim (struct mem_read_abstraction_base *mra, enum operator hint); -static enum operator psh_pul_discrim (struct mem_read_abstraction_base *mra, enum operator hint); -static enum operator mul_discrim (struct mem_read_abstraction_base *mra, enum operator hint); -static enum operator loop_primitive_discrim (struct mem_read_abstraction_base *mra, enum operator hint); -static enum operator bit_field_discrim (struct mem_read_abstraction_base *mra, enum operator hint); -static enum operator exg_sex_discrim (struct mem_read_abstraction_base *mra, enum operator hint); +static enum optr shift_discrim (struct mem_read_abstraction_base *mra, enum optr hint); +static enum optr psh_pul_discrim (struct mem_read_abstraction_base *mra, enum optr hint); +static enum optr mul_discrim (struct mem_read_abstraction_base *mra, enum optr hint); +static enum optr loop_primitive_discrim (struct mem_read_abstraction_base *mra, enum optr hint); +static enum optr bit_field_discrim (struct mem_read_abstraction_base *mra, enum optr hint); +static enum optr exg_sex_discrim (struct mem_read_abstraction_base *mra, enum optr hint); static void @@ -1005,8 +1005,8 @@ sub_d6_y_x (struct mem_read_abstraction_base *mra ATTRIBUTE_UNUSED, static void ld_18bit_decode (struct mem_read_abstraction_base *mra, int *n_operands, struct operand **operand); -static enum operator -mul_discrim (struct mem_read_abstraction_base *mra, enum operator hint) +static enum optr +mul_discrim (struct mem_read_abstraction_base *mra, enum optr hint) { uint8_t mb; int status = mra->read (mra, 0, 1, &mb); @@ -1042,7 +1042,7 @@ mul_discrim (struct mem_read_abstraction_base *mra, enum operator hint) struct opcode { /* The operation that this opcode performs. */ - enum operator operator; + enum optr operator; /* The size of this operation. May be -1 if it is implied in the operands or if size is not applicable. */ @@ -2196,8 +2196,8 @@ loop_prim_n_bytes (struct mem_read_abstraction_base *mra) -static enum operator -exg_sex_discrim (struct mem_read_abstraction_base *mra, enum operator hint ATTRIBUTE_UNUSED) +static enum optr +exg_sex_discrim (struct mem_read_abstraction_base *mra, enum optr hint ATTRIBUTE_UNUSED) { uint8_t eb; int status = mra->read (mra, 0, 1, &eb); @@ -2210,7 +2210,7 @@ exg_sex_discrim (struct mem_read_abstraction_base *mra, enum operator hint ATTRI const struct reg *r0 = registers + ((struct register_operand *) op0)->reg; const struct reg *r1 = registers + ((struct register_operand *) op1)->reg; - enum operator operator = (r0->bytes < r1->bytes) ? OP_sex : OP_exg; + enum optr operator = (r0->bytes < r1->bytes) ? OP_sex : OP_exg; free (op0); free (op1); @@ -2233,16 +2233,16 @@ exg_sex_decode (struct mem_read_abstraction_base *mra, operands[(*n_operands)++] = create_register_operand (eb & 0xf); } -static enum operator +static enum optr loop_primitive_discrim (struct mem_read_abstraction_base *mra, - enum operator hint ATTRIBUTE_UNUSED) + enum optr hint ATTRIBUTE_UNUSED) { uint8_t lb; int status = mra->read (mra, 0, 1, &lb); if (status < 0) return OP_INVALID; - enum operator opbase = (lb & 0x80) ? OP_dbNE : OP_tbNE; + enum optr opbase = (lb & 0x80) ? OP_dbNE : OP_tbNE; return opbase + ((lb & 0x70) >> 4); } @@ -2287,8 +2287,8 @@ loop_primitive_decode (struct mem_read_abstraction_base *mra, } -static enum operator -shift_discrim (struct mem_read_abstraction_base *mra, enum operator hint ATTRIBUTE_UNUSED) +static enum optr +shift_discrim (struct mem_read_abstraction_base *mra, enum optr hint ATTRIBUTE_UNUSED) { size_t i; uint8_t sb; @@ -2474,9 +2474,9 @@ shift_decode (struct mem_read_abstraction_base *mra, int *n_operands, struct op } } -static enum operator +static enum optr psh_pul_discrim (struct mem_read_abstraction_base *mra, - enum operator hint ATTRIBUTE_UNUSED) + enum optr hint ATTRIBUTE_UNUSED) { uint8_t byte; int status = mra->read (mra, 0, 1, &byte); @@ -2528,8 +2528,8 @@ psh_pul_decode (struct mem_read_abstraction_base *mra, } } -static enum operator -bit_field_discrim (struct mem_read_abstraction_base *mra, enum operator hint ATTRIBUTE_UNUSED) +static enum optr +bit_field_discrim (struct mem_read_abstraction_base *mra, enum optr hint ATTRIBUTE_UNUSED) { int status; bfd_byte bb; @@ -2647,12 +2647,12 @@ bit_field_decode (struct mem_read_abstraction_base *mra, The operation to be performed is returned. The number of operands, will be placed in N_OPERANDS. The operands themselved into OPERANDS. */ -static enum operator +static enum optr decode_operation (const struct opcode *opc, struct mem_read_abstraction_base *mra, int *n_operands, struct operand **operands) { - enum operator op = opc->operator; + enum optr op = opc->operator; if (opc->discriminator) op = opc->discriminator (mra, opc->operator); @@ -2666,7 +2666,7 @@ decode_operation (const struct opcode *opc, } int -decode_s12z (enum operator *myoperator, short *osize, +decode_s12z (enum optr *myoperator, short *osize, int *n_operands, struct operand **operands, struct mem_read_abstraction_base *mra) { diff --git a/opcodes/s12z-opc.h b/opcodes/s12z-opc.h index 186a7f29c3f..04e15595b38 100644 --- a/opcodes/s12z-opc.h +++ b/opcodes/s12z-opc.h @@ -34,7 +34,7 @@ struct mem_read_abstraction_base /* Machine code operators. These *roughly* correspond to opcodes. But describe their purpose rather than their form. */ -enum operator +enum optr { OP_INVALID = 0, @@ -259,7 +259,7 @@ struct memory_operand It is the responsibility of the caller to free all operands when they are no longer needed. Returns the number of bytes read. */ -int decode_s12z (enum operator *myoperator, short *osize, +int decode_s12z (enum optr *myoperator, short *osize, int *n_operands, struct operand **operands, struct mem_read_abstraction_base *); -- 2.30.2