[binutils-gdb] d30v: use is_whitespace()

Jan Beulich jbeulich@sourceware.org
Mon Feb 3 10:57:50 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2ce2556f849f2e42382473efcf12ccf0a35c8e52

commit 2ce2556f849f2e42382473efcf12ccf0a35c8e52
Author: Jan Beulich <jbeulich@suse.com>
Date:   Mon Feb 3 11:56:13 2025 +0100

    d30v: 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). Also convert open-coded checks where tabs were
    already included. At the same time use is_end_of_stmt() instead of open-
    coded checks in adjacent code.

Diff:
---
 gas/config/tc-d30v.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c
index d465b2a2214..c3c58d11980 100644
--- a/gas/config/tc-d30v.c
+++ b/gas/config/tc-d30v.c
@@ -164,7 +164,7 @@ register_name (expressionS *expressionP)
   int reg_number;
   char c, *p = input_line_pointer;
 
-  while (*p && *p != '\n' && *p != '\r' && *p != ',' && *p != ' ' && *p != ')')
+  while (!is_end_of_stmt (*p) && *p != ',' && !is_whitespace (*p) && *p != ')')
     p++;
 
   c = *p;
@@ -328,7 +328,7 @@ postfix (char *p)
 {
   while (*p != '-' && *p != '+')
     {
-      if (*p == 0 || *p == '\n' || *p == '\r' || *p == ' ' || *p == ',')
+      if (is_end_of_stmt (*p) || is_whitespace (*p) || *p == ',')
 	break;
       p++;
     }
@@ -400,7 +400,7 @@ get_operands (expressionS exp[], int cmp_hack)
 
   while (*p)
     {
-      while (*p == ' ' || *p == '\t' || *p == ',')
+      while (is_whitespace (*p) || *p == ',')
 	p++;
 
       if (*p == 0 || *p == '\n' || *p == '\r')
@@ -1294,7 +1294,7 @@ do_assemble (char *str,
   long long      insn;
 
   /* Drop leading whitespace.  */
-  while (*str == ' ')
+  while (is_whitespace (*str))
     str++;
 
   /* Find the opcode end.  */
@@ -1302,7 +1302,7 @@ do_assemble (char *str,
        *op_end
        && nlen < (NAME_BUF_LEN - 1)
        && *op_end != '/'
-       && !is_end_of_line[(unsigned char) *op_end] && *op_end != ' ';
+       && !is_end_of_stmt (*op_end) && !is_whitespace (*op_end);
        op_end++)
     {
       name[nlen] = TOLOWER (op_start[nlen]);
@@ -1829,7 +1829,7 @@ d30v_start_line (void)
 {
   char *c = input_line_pointer;
 
-  while (ISSPACE (*c))
+  while (is_whitespace (*c))
     c++;
 
   if (*c == '.')


More information about the Binutils-cvs mailing list