diff options
author | Jan Beulich <jbeulich@suse.com> | 2025-02-03 12:19:05 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2025-02-03 12:19:05 +0100 |
commit | 49343ef90494e119c0c1ac4740606ab360990a56 (patch) | |
tree | 9cb39141070b9ce93adc49ca3e97a2718234b136 | |
parent | 0a4e0f2a78825a80714616b35968744f555dabaa (diff) | |
download | binutils-49343ef90494e119c0c1ac4740606ab360990a56.zip binutils-49343ef90494e119c0c1ac4740606ab360990a56.tar.gz binutils-49343ef90494e119c0c1ac4740606ab360990a56.tar.bz2 |
RISC-V: use is_whitespace()
Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Switch places already checking for tabs to use the
macro, too.
-rw-r--r-- | gas/config/tc-riscv.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 79ff083..eb0d681 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -2484,7 +2484,7 @@ parse_relocation (char **str, bfd_reloc_code_real_type *reloc, { size_t len = 1 + strlen (percent_op->str); - while (ISSPACE ((*str)[len])) + while (is_whitespace ((*str)[len])) ++len; if ((*str)[len] != '(') continue; @@ -2548,7 +2548,7 @@ my_getSmallExpression (expressionS *ep, bfd_reloc_code_real_type *reloc, /* Skip over whitespace and brackets, keeping count of the number of brackets. */ - while (*str == ' ' || *str == '\t' || *str == '(') + while (is_whitespace (*str) || *str == '(') if (*str++ == '(') str_depth++; } @@ -2577,7 +2577,7 @@ my_getSmallExpression (expressionS *ep, bfd_reloc_code_real_type *reloc, probing_insn_operands = orig_probing; /* Match every open bracket. */ - while (crux_depth > 0 && (*str == ')' || *str == ' ' || *str == '\t')) + while (crux_depth > 0 && (*str == ')' || is_whitespace (*str))) if (*str++ == ')') crux_depth--; @@ -2844,7 +2844,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, /* Parse the name of the instruction. Terminate the string if whitespace is found so that str_hash_find only sees the name part of the string. */ for (asarg = str; *asarg!= '\0'; ++asarg) - if (ISSPACE (*asarg)) + if (is_whitespace (*asarg)) { save_c = *asarg; *asarg++ = '\0'; @@ -2891,7 +2891,8 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, for (oparg = insn->args;; ++oparg) { opargStart = oparg; - asarg += strspn (asarg, " \t"); + while (is_whitespace (*asarg)) + ++asarg; switch (*oparg) { case '\0': /* End of args. */ @@ -3520,7 +3521,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, if (reg_lookup (&asarg, RCLASS_GPR, ®no)) { char c = *oparg; - if (*asarg == ' ') + if (is_whitespace (*asarg)) ++asarg; /* Now that we have assembled one operand, we use the args @@ -3554,7 +3555,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, ? RCLASS_GPR : RCLASS_FPR), ®no)) { char c = *oparg; - if (*asarg == ' ') + if (is_whitespace (*asarg)) ++asarg; switch (c) { @@ -4963,7 +4964,7 @@ s_riscv_option (int x ATTRIBUTE_UNUSED) else if (strncmp (name, "arch,", 5) == 0) { name += 5; - if (ISSPACE (*name) && *name != '\0') + if (is_whitespace (*name) && *name != '\0') name++; riscv_update_subset (&riscv_rps_as, name); riscv_set_arch_str (&riscv_rps_as.subset_list->arch_str); |