[PATCH 6/7] RISC-V: use is_whitespace()

Nelson Chu nelson@rivosinc.com
Tue Aug 20 01:44:17 GMT 2024


Looks good, thanks.

Nelson

On Fri, Aug 9, 2024 at 8:55 PM Jan Beulich <jbeulich@suse.com> wrote:

> 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. Note however that elsewhere in the file ISSPACE() is also
> used; probably the file should be consistent either way.
>
> --- a/gas/config/tc-riscv.c
> +++ b/gas/config/tc-riscv.c
> @@ -2505,7 +2505,7 @@ my_getSmallExpression (expressionS *ep,
>
>        /* 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++;
>      }
> @@ -2534,7 +2534,7 @@ my_getSmallExpression (expressionS *ep,
>    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--;
>
> @@ -3480,7 +3480,7 @@ riscv_ip (char *str, struct riscv_cl_ins
>               if (reg_lookup (&asarg, RCLASS_GPR, &regno))
>                 {
>                   char c = *oparg;
> -                 if (*asarg == ' ')
> +                 if (is_whitespace (*asarg))
>                     ++asarg;
>
>                   /* Now that we have assembled one operand, we use the
> args
> @@ -3514,7 +3514,7 @@ riscv_ip (char *str, struct riscv_cl_ins
>                               ? RCLASS_GPR : RCLASS_FPR), &regno))
>                 {
>                   char c = *oparg;
> -                 if (*asarg == ' ')
> +                 if (is_whitespace (*asarg))
>                     ++asarg;
>                   switch (c)
>                     {
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20240820/93aa34e1/attachment.htm>


More information about the Binutils mailing list