[PATCH 6/7] RISC-V: use is_whitespace()
Jan Beulich
jbeulich@suse.com
Tue Aug 20 07:13:50 GMT 2024
On 20.08.2024 03:44, Nelson Chu wrote:
> Looks good, thanks.
No opinion then on is_whitespace() vs ISSPACE()?
Jan
> 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, ®no))
>> {
>> 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), ®no))
>> {
>> char c = *oparg;
>> - if (*asarg == ' ')
>> + if (is_whitespace (*asarg))
>> ++asarg;
>> switch (c)
>> {
>>
>>
>
More information about the Binutils
mailing list