diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2016-06-14 18:19:48 +0100 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2016-08-23 09:41:01 +0100 |
commit | 2d0a5f0d0a2d51d31fb4394d0732ec623c069958 (patch) | |
tree | bad5c72f049acd741615fd71a102b875d84de9a4 | |
parent | 344bde0a7f812ff03139ab53aecd61674eb143bf (diff) | |
download | gdb-2d0a5f0d0a2d51d31fb4394d0732ec623c069958.zip gdb-2d0a5f0d0a2d51d31fb4394d0732ec623c069958.tar.gz gdb-2d0a5f0d0a2d51d31fb4394d0732ec623c069958.tar.bz2 |
[AArch64][SVE 01/32] Remove parse_neon_operand_type
A false return from parse_neon_operand_type had an overloaded
meaning: either the parsing failed, or there was nothing to parse
(which isn't necessarily an error). The only caller, parse_typed_reg,
would therefore not consume the suffix if it was invalid but instead
(successfully) parse the register without a suffix. It would still
leave inst.parsing_error with an error about the invalid suffix.
It seems wrong for a successful parse to leave an error message,
so this patch makes parse_typed_reg return PARSE_FAIL instead.
The patch doesn't seem to make much difference in practice.
Most possible follow-on errors use set_first_error and so the
error about the suffix tended to win despite the successful parse.
gas/
* config/tc-aarch64.c (parse_neon_operand_type): Delete.
(parse_typed_reg): Call parse_neon_type_for_operand directly.
Change-Id: I0b9c9048672c19390007452ae7fab5603fa03e4e
-rw-r--r-- | gas/config/tc-aarch64.c | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 34fdc53..ce8e713 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -821,31 +821,6 @@ elt_size: return TRUE; } -/* Parse a single type, e.g. ".8b", leading period included. - Only applicable to Vn registers. - - Return TRUE on success; otherwise return FALSE. */ -static bfd_boolean -parse_neon_operand_type (struct neon_type_el *vectype, char **ccp) -{ - char *str = *ccp; - - if (*str == '.') - { - if (! parse_neon_type_for_operand (vectype, &str)) - { - first_error (_("vector type expected")); - return FALSE; - } - } - else - return FALSE; - - *ccp = str; - - return TRUE; -} - /* Parse a register of the type TYPE. Return PARSE_FAIL if the string pointed by *CCP is not a valid register @@ -889,9 +864,11 @@ parse_typed_reg (char **ccp, aarch64_reg_type type, aarch64_reg_type *rtype, } type = reg->type; - if (type == REG_TYPE_VN - && parse_neon_operand_type (&parsetype, &str)) + if (type == REG_TYPE_VN && *str == '.') { + if (!parse_neon_type_for_operand (&parsetype, &str)) + return PARSE_FAIL; + /* Register if of the form Vn.[bhsdq]. */ is_typed_vecreg = TRUE; |