[v2,55/65] C6x: use is_whitespace()

Message ID 9b3e59ea-6ae2-41e8-93bb-f25b4f5c6bb1@suse.com
State New
Headers
Series gas: whitespace handling |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed

Commit Message

Jan Beulich Jan. 27, 2025, 4:41 p.m. UTC
  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.
---
v2: New.
  

Patch

--- a/gas/config/tc-tic6x.c
+++ b/gas/config/tc-tic6x.c
@@ -489,7 +489,8 @@  s_tic6x_arch (int ignored ATTRIBUTE_UNUS
   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;