aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2025-02-03 12:25:28 +0100
committerJan Beulich <jbeulich@suse.com>2025-02-03 12:25:28 +0100
commitbf0e6c6cd5cd84d3bbce6783c05f3b5b6d375e46 (patch)
tree26f119ec5a3d133b4909e9d27ad14f14d5601a8c
parent74ac8f7accb9e60bc1328ee1322656719d4320f7 (diff)
downloadbinutils-bf0e6c6cd5cd84d3bbce6783c05f3b5b6d375e46.zip
binutils-bf0e6c6cd5cd84d3bbce6783c05f3b5b6d375e46.tar.gz
binutils-bf0e6c6cd5cd84d3bbce6783c05f3b5b6d375e46.tar.bz2
C6x: 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 convert an ISSPACE() use. At the same time use is_end_of_stmt() instead of open-coded checks in adjacent code.
-rw-r--r--gas/config/tc-tic6x.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gas/config/tc-tic6x.c b/gas/config/tc-tic6x.c
index b256ddf..93a968c 100644
--- a/gas/config/tc-tic6x.c
+++ b/gas/config/tc-tic6x.c
@@ -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;