From: Jan Beulich Date: Mon, 3 Feb 2025 10:58:32 +0000 (+0100) Subject: C-Sky: use is_whitespace() X-Git-Tag: binutils-2_45~1754 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8075b3eb668d1239308c5610dc34f99edc4206f3;p=thirdparty%2Fbinutils-gdb.git C-Sky: 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 switch ISSPACE() uses over. At the same time use is_end_of_stmt() instead of kind-of-open-coded checks. --- diff --git a/gas/config/tc-csky.c b/gas/config/tc-csky.c index df98c88459c..5ff7458e2c5 100644 --- a/gas/config/tc-csky.c +++ b/gas/config/tc-csky.c @@ -2287,7 +2287,7 @@ parse_exp (char *s, expressionS *e) char *new; /* Skip whitespace. */ - while (ISSPACE (*s)) + while (is_whitespace (*s)) ++s; save = input_line_pointer; @@ -3325,14 +3325,14 @@ parse_opcode (char *str) char macro_name[OPCODE_MAX_LEN + 1]; /* Remove space ahead of string. */ - while (ISSPACE (*str)) + while (is_whitespace (*str)) str++; opcode_end = str; /* Find the opcode end. */ while (nlen < OPCODE_MAX_LEN - && !is_end_of_line [(unsigned char) *opcode_end] - && *opcode_end != ' ') + && !is_end_of_stmt (*opcode_end) + && !is_whitespace (*opcode_end)) { /* Is csky force 32 or 16 instruction? */ if (IS_CSKY_V2 (mach_flag) @@ -3378,7 +3378,7 @@ parse_opcode (char *str) macro_name[nlen] = '\0'; /* Get csky_insn.opcode_end. */ - while (ISSPACE (*opcode_end)) + while (is_whitespace (*opcode_end)) opcode_end++; csky_insn.opcode_end = opcode_end; @@ -4333,13 +4333,13 @@ parse_operands_op (char *str, struct csky_opcode_info *op) for (j = 0; j < csky_insn.number; j++) { - while (ISSPACE (*oper)) + while (is_whitespace (*oper)) oper++; flag_pass = get_operand_value (&op[i], &oper, &op[i].oprnd.oprnds[j]); if (!flag_pass) break; - while (ISSPACE (*oper)) + while (is_whitespace (*oper)) oper++; /* Skip the ','. */ if (j < csky_insn.number - 1 && op[i].operand_num != -1) @@ -4578,7 +4578,7 @@ md_assemble (char *str) mapping_state (MAP_TEXT); /* Tie dwarf2 debug info to every insn if set option --gdwarf2. */ dwarf2_emit_insn (0); - while (ISSPACE (* str)) + while (is_whitespace (* str)) str++; /* Get opcode from str. */ if (!parse_opcode (str)) @@ -5905,7 +5905,7 @@ static int csky_get_macro_operand (char *src_s, char *dst_s, char end_sym) { int nlen = 0; - while (ISSPACE (*src_s)) + while (is_whitespace (*src_s)) ++src_s; while (*src_s != end_sym) dst_s[nlen++] = *(src_s++); @@ -7778,11 +7778,11 @@ csky_s_section (int ignore) pool. */ char * ilp = input_line_pointer; - while (*ilp != 0 && ISSPACE (*ilp)) + while (is_whitespace (*ilp)) ++ ilp; if (startswith (ilp, ".line") - && (ISSPACE (ilp[5]) || *ilp == '\n' || *ilp == '\r')) + && (is_whitespace (ilp[5]) || is_end_of_stmt (ilp[5]))) ; else dump_literals (0);