AArch64: Refactor err_type.

Previously the ERR_ values were defined as different constants, to make this a
bit more type safe and so they can be more easily re-used I'm changing them into
an actual enum and updating any usages.

include/

	* opcode/aarch64.h (enum err_type): New.
	(aarch64_decode_insn): Use it.

opcodes/

	* aarch64-dis.c (ERR_OK, ERR_UND, ERR_UNP, ERR_NYI): Remove.
	(aarch64_decode_insn, print_insn_aarch64_word): Use err_type.
This commit is contained in:
Tamar Christina
2018-10-03 18:35:15 +01:00
parent 7e84b55d8f
commit 1d4823943d
4 changed files with 29 additions and 14 deletions

View File

@ -641,6 +641,16 @@ enum aarch64_op
OP_TOTAL_NUM, /* Pseudo. */
};
/* Error types. */
enum err_type
{
ERR_OK,
ERR_UND,
ERR_UNP,
ERR_NYI,
ERR_NR_ENTRIES
};
/* Maximum number of operands an instruction can have. */
#define AARCH64_MAX_OPND_NUM 6
/* Maximum number of qualifier sequences an instruction can have. */
@ -1187,7 +1197,7 @@ aarch64_stack_pointer_p (const aarch64_opnd_info *);
extern int
aarch64_zero_register_p (const aarch64_opnd_info *);
extern int
extern enum err_type
aarch64_decode_insn (aarch64_insn, aarch64_inst *, bfd_boolean,
aarch64_operand_error *errors);