[v2,53/65] C4x: use is_whitespace()

Message ID 80e696a8-a932-494b-9049-e74349de8f75@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:40 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). At the same time use is_end_of_stmt() instead of
kind-of-open-coded checks in adjacent code.
---
v2: New.
  

Patch

--- a/gas/config/tc-tic4x.c
+++ b/gas/config/tc-tic4x.c
@@ -1472,7 +1472,7 @@  tic4x_indirect_parse (tic4x_operand_t *o
 	  s++;
 	}
     }
-  if (*s != ' ' && *s != ',' && *s != '\0')
+  if (!is_whitespace (*s) && *s != ',' && !is_end_of_stmt (*s))
     return 0;
   input_line_pointer = s;
   return 1;
@@ -2428,7 +2428,7 @@  md_assemble (char *str)
       /* Find mnemonic (second part of parallel instruction).  */
       s = str;
       /* Skip past instruction mnemonic.  */
-      while (*s && *s != ' ')
+      while (!is_end_of_stmt (*s) && !is_whitespace (*s))
 	s++;
       if (*s)			/* Null terminate for str_hash_find.  */
 	*s++ = '\0';		/* and skip past null.  */
@@ -2492,7 +2492,7 @@  md_assemble (char *str)
     {
       /* Find mnemonic.  */
       s = str;
-      while (*s && *s != ' ')	/* Skip past instruction mnemonic.  */
+      while (!is_end_of_stmt (*s) && !is_whitespace (*s))	/* Skip past instruction mnemonic.  */
 	s++;
       if (*s)			/* Null terminate for str_hash_find.  */
 	*s++ = '\0';		/* and skip past null.  */