[v2,64/65] Z8k: use is_whitespace()

Message ID 71660065-50c2-49f6-b971-c258712ec328@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_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed

Commit Message

Jan Beulich Jan. 27, 2025, 4:46 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 an
open-coded check in adjacent code.
---
v2: New.
  

Comments

Christian Groessler Jan. 30, 2025, 10:16 a.m. UTC | #1
On 1/27/25 17:46, Jan Beulich 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). At the same time use is_end_of_stmt() instead of an
> open-coded check in adjacent code.
> ---
> v2: New.
> 
 > ....


Ok.

regards,
chris
  

Patch

--- a/gas/config/tc-z8k.c
+++ b/gas/config/tc-z8k.c
@@ -429,7 +429,7 @@  get_ctrl_operand (char **ptr, struct z8k
   char *src = *ptr;
   int i, l;
 
-  while (*src == ' ')
+  while (is_whitespace (*src))
     src++;
 
   mode->mode = CLASS_CTRL;
@@ -472,7 +472,7 @@  get_flags_operand (char **ptr, struct z8
   int i;
   int j;
 
-  while (*src == ' ')
+  while (is_whitespace (*src))
     src++;
 
   mode->mode = CLASS_FLAGS;
@@ -517,7 +517,7 @@  get_interrupt_operand (char **ptr, struc
   char *src = *ptr;
   int i, l;
 
-  while (*src == ' ')
+  while (is_whitespace (*src))
     src++;
 
   mode->mode = CLASS_IMM;
@@ -607,7 +607,7 @@  get_cc_operand (char **ptr, struct z8k_o
   char *src = *ptr;
   int i, l;
 
-  while (*src == ' ')
+  while (is_whitespace (*src))
     src++;
 
   mode->mode = CLASS_CC;
@@ -634,7 +634,7 @@  get_operand (char **ptr, struct z8k_op *
 
   mode->mode = 0;
 
-  while (*src == ' ')
+  while (is_whitespace (*src))
     src++;
   if (*src == '#')
     {
@@ -737,7 +737,7 @@  get_operands (const opcode_entry_type *o
     case 0:
       operand[0].mode = 0;
       operand[1].mode = 0;
-      while (*ptr == ' ')
+      while (is_whitespace (*ptr))
         ptr++;
       break;
 
@@ -745,7 +745,7 @@  get_operands (const opcode_entry_type *o
       if (opcode->arg_info[0] == CLASS_CC)
         {
           get_cc_operand (&ptr, operand + 0, 0);
-          while (*ptr == ' ')
+          while (is_whitespace (*ptr))
             ptr++;
           if (*ptr && ! is_end_of_line[(unsigned char) *ptr])
             {
@@ -757,7 +757,7 @@  get_operands (const opcode_entry_type *o
       else if (opcode->arg_info[0] == CLASS_FLAGS)
 	{
 	  get_flags_operand (&ptr, operand + 0, 0);
-	  while (*ptr == ' ')
+	  while (is_whitespace (*ptr))
 	    ptr++;
 	  if (*ptr && ! is_end_of_line[(unsigned char) *ptr])
 	    {
@@ -779,7 +779,7 @@  get_operands (const opcode_entry_type *o
       if (opcode->arg_info[0] == CLASS_CC)
         {
           get_cc_operand (&ptr, operand + 0, 0);
-          while (*ptr == ' ')
+          while (is_whitespace (*ptr))
             ptr++;
           if (*ptr != ',' && strchr (ptr + 1, ','))
             {
@@ -1219,12 +1219,12 @@  md_assemble (char *str)
   opcode_entry_type *opcode;
 
   /* Drop leading whitespace.  */
-  while (*str == ' ')
+  while (is_whitespace (*str))
     str++;
 
   /* Find the op code end.  */
   for (op_start = op_end = str;
-       *op_end != 0 && *op_end != ' ' && ! is_end_of_line[(unsigned char) *op_end];
+       ! is_whitespace (*op_end) && ! is_end_of_stmt (*op_end);
        op_end++)
     ;
 
@@ -1258,7 +1258,7 @@  md_assemble (char *str)
 
       oc = *old;
       *old = '\n';
-      while (*input_line_pointer == ' ')
+      while (is_whitespace (*input_line_pointer))
 	input_line_pointer++;
       p = (pseudo_typeS *) (opcode->func);