]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
C6x: use is_whitespace()
authorJan Beulich <jbeulich@suse.com>
Mon, 3 Feb 2025 11:25:28 +0000 (12:25 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 3 Feb 2025 11:25:28 +0000 (12:25 +0100)
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 an ISSPACE() use. At the same time use
is_end_of_stmt() instead of open-coded checks in adjacent code.

gas/config/tc-tic6x.c

index b256ddf34dfb6cc850c470c6fed04d80c0343b56..93a968c8f0a5d6e086de8106884671e10ddba441 100644 (file)
@@ -489,7 +489,8 @@ s_tic6x_arch (int ignored ATTRIBUTE_UNUSED)
   char *arch;
 
   arch = input_line_pointer;
-  while (*input_line_pointer && !ISSPACE (*input_line_pointer))
+  while (!is_end_of_stmt (*input_line_pointer)
+        && !is_whitespace (*input_line_pointer))
     input_line_pointer++;
   c = *input_line_pointer;
   *input_line_pointer = 0;
@@ -1180,7 +1181,7 @@ typedef struct
   } value;
 } tic6x_operand;
 
-#define skip_whitespace(str)  do { if (*(str) == ' ') ++(str); } while (0)
+#define skip_whitespace(str)  do { if (is_whitespace (*(str))) ++(str); } while (0)
 
 /* Parse a register operand, or part of an operand, starting at *P.
    If syntactically OK (including that the number is in the range 0 to
@@ -3148,7 +3149,7 @@ md_assemble (char *str)
   char *output;
 
   p = str;
-  while (*p && !is_end_of_line[(unsigned char) *p] && *p != ' ')
+  while (!is_end_of_stmt (*p) && !is_whitespace (*p))
     p++;
 
   /* This function should only have been called when there is actually
@@ -3208,10 +3209,10 @@ md_assemble (char *str)
 
       if (good_func_unit)
        {
-         if (p[3] == ' ' || is_end_of_line[(unsigned char) p[3]])
+         if (is_whitespace (p[3]) || is_end_of_stmt (p[3]))
            p += 3;
          else if ((p[3] == 'x' || p[3] == 'X')
-                  && (p[4] == ' ' || is_end_of_line[(unsigned char) p[4]]))
+                  && (is_whitespace (p[4]) || is_end_of_stmt (p[4])))
            {
              maybe_cross = 1;
              p += 4;
@@ -3219,7 +3220,7 @@ md_assemble (char *str)
          else if (maybe_base == tic6x_func_unit_d
                   && (p[3] == 't' || p[3] == 'T')
                   && (p[4] == '1' || p[4] == '2')
-                  && (p[5] == ' ' || is_end_of_line[(unsigned char) p[5]]))
+                  && (is_whitespace (p[5]) || is_end_of_stmt (p[5])))
            {
              maybe_data_side = p[4] - '0';
              p += 5;