diff options
author | Jan Beulich <jbeulich@suse.com> | 2024-10-14 14:37:29 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2024-10-14 14:37:29 +0200 |
commit | b03815327ab1bc34b1784455ca56c2b626cf5794 (patch) | |
tree | 1e1698c20ad3bf2241c31afebf528d5324ce292a | |
parent | a227513b8b7bcfcb7ee33a5c437cd9cf8e2bdc86 (diff) | |
download | gdb-b03815327ab1bc34b1784455ca56c2b626cf5794.zip gdb-b03815327ab1bc34b1784455ca56c2b626cf5794.tar.gz gdb-b03815327ab1bc34b1784455ca56c2b626cf5794.tar.bz2 |
gas: drop SKIP_WHITESPACE_AFTER_NAME()
Exclusively all users should use restore_line_pointer() instead, at
which point SKIP_WHITESPACE() suffices as a check afterwards.
-rw-r--r-- | gas/config/obj-coff.c | 8 | ||||
-rw-r--r-- | gas/config/obj-elf.c | 12 | ||||
-rw-r--r-- | gas/config/obj-macho.c | 8 | ||||
-rw-r--r-- | gas/config/obj-som.c | 4 | ||||
-rw-r--r-- | gas/config/tc-alpha.c | 20 | ||||
-rw-r--r-- | gas/config/tc-arc.c | 4 | ||||
-rw-r--r-- | gas/config/tc-dlx.c | 4 | ||||
-rw-r--r-- | gas/config/tc-ia64.c | 37 | ||||
-rw-r--r-- | gas/config/tc-m32r.c | 4 | ||||
-rw-r--r-- | gas/config/tc-mips.c | 8 | ||||
-rw-r--r-- | gas/config/tc-ppc.c | 12 | ||||
-rw-r--r-- | gas/config/tc-score7.c | 4 | ||||
-rw-r--r-- | gas/config/tc-sparc.c | 8 | ||||
-rw-r--r-- | gas/config/tc-tic4x.c | 4 | ||||
-rw-r--r-- | gas/config/tc-xtensa.c | 4 | ||||
-rw-r--r-- | gas/dw2gencfi.c | 4 | ||||
-rw-r--r-- | gas/dwarf2dbg.c | 8 | ||||
-rw-r--r-- | gas/expr.c | 4 | ||||
-rw-r--r-- | gas/read.c | 12 | ||||
-rw-r--r-- | gas/read.h | 10 | ||||
-rw-r--r-- | gas/stabs.c | 4 |
21 files changed, 85 insertions, 98 deletions
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index 845fcc8..67f0b0f 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -1150,8 +1150,8 @@ obj_coff_weak (int ignore ATTRIBUTE_UNUSED) } c = 0; symbolP = symbol_find_or_make (name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); S_SET_WEAK (symbolP); if (c == ',') @@ -1557,8 +1557,8 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED) c = get_symbol_name (§ion_name); name = xmemdup0 (section_name, input_line_pointer - section_name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); exp = 0; flags = SEC_NO_FLAGS; diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index b9aaca9..d8af4b7 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -344,8 +344,8 @@ get_sym_from_input_line_and_check (void) c = get_symbol_name (& name); sym = symbol_find_or_make (name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); /* There is no symbol name if input_line_pointer has not moved. */ if (name == input_line_pointer) @@ -1937,9 +1937,9 @@ obj_elf_get_vtable_inherit (void) bad = 1; } - *input_line_pointer = c; + restore_line_pointer (c); - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { as_bad (_("expected comma after name in .vtable_inherit")); @@ -2353,8 +2353,8 @@ obj_elf_size (int ignore ATTRIBUTE_UNUSED) symbolS *sym; p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { *p = 0; diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c index 812d539..528e651 100644 --- a/gas/config/obj-macho.c +++ b/gas/config/obj-macho.c @@ -471,7 +471,7 @@ obj_mach_o_zerofill (int ignore ATTRIBUTE_UNUSED) c = get_symbol_name (&name); /* Just after name is now '\0'. */ p = input_line_pointer; - *p = c; + restore_line_pointer (c); if (name == p) { @@ -480,7 +480,7 @@ obj_mach_o_zerofill (int ignore ATTRIBUTE_UNUSED) goto done; } - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (*input_line_pointer == ',') input_line_pointer++; @@ -1128,8 +1128,8 @@ obj_mach_o_sym_qual (int ntype) c = get_symbol_name (&name); symbolP = symbol_find_or_make (name); obj_mach_o_set_symbol_qualifier (symbolP, ntype); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); c = *input_line_pointer; if (c == ',') { diff --git a/gas/config/obj-som.c b/gas/config/obj-som.c index 68d30f0..af3e53a 100644 --- a/gas/config/obj-som.c +++ b/gas/config/obj-som.c @@ -308,8 +308,8 @@ obj_som_weak (int ignore ATTRIBUTE_UNUSED) { c = get_symbol_name (&name); symbolP = symbol_find_or_make (name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); S_SET_WEAK (symbolP); if (c == ',') { diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index 283cbb1..0922f19 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -936,8 +936,8 @@ tokenize_arguments (char *str, goto err_report; } - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != '!') { if (r->require_seq) @@ -3499,9 +3499,9 @@ s_alpha_comm (int ignore ATTRIBUTE_UNUSED) /* Just after name is now '\0'. */ p = input_line_pointer; - *p = c; + restore_line_pointer (c); - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); /* Alpha OSF/1 compiler doesn't provide the comma, gcc does. */ if (*input_line_pointer == ',') @@ -3746,8 +3746,8 @@ s_alpha_ent (int dummy ATTRIBUTE_UNUSED) /* The .ent directive is sometimes followed by a number. Not sure what it really means, but ignore it. */ - *input_line_pointer = name_end; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (name_end); + SKIP_WHITESPACE (); if (*input_line_pointer == ',') { input_line_pointer++; @@ -4316,11 +4316,11 @@ s_alpha_section (int secid) SKIP_WHITESPACE (); c = get_symbol_name (&beg); - *input_line_pointer = c; + restore_line_pointer (c); vms_flags |= s_alpha_section_word (beg, input_line_pointer - beg); - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); } while (*input_line_pointer++ == ','); @@ -4938,8 +4938,8 @@ s_alpha_proc (int is_static ATTRIBUTE_UNUSED) c = get_symbol_name (&name); p = input_line_pointer; symbolP = symbol_find_or_make (name); - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { *p = 0; diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c index f7d8e89..5fd265a 100644 --- a/gas/config/tc-arc.c +++ b/gas/config/tc-arc.c @@ -1152,8 +1152,8 @@ parse_reloc_symbol (expressionS *resultP) return; } - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); /* Extra check for TLS: base. */ if (*input_line_pointer == '@') { diff --git a/gas/config/tc-dlx.c b/gas/config/tc-dlx.c index c538abe..6a7c520 100644 --- a/gas/config/tc-dlx.c +++ b/gas/config/tc-dlx.c @@ -234,8 +234,8 @@ s_proc (int end_p) delim1 = get_symbol_name (&name); name = xstrdup (name); - *input_line_pointer = delim1; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (delim1); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index a1b1e61..666c0ae 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -4199,24 +4199,23 @@ dot_unwabi (int dummy ATTRIBUTE_UNUSED) static void dot_personality (int dummy ATTRIBUTE_UNUSED) { - char *name, *p, c; + char *name, c; if (!in_procedure ("personality")) return; SKIP_WHITESPACE (); c = get_symbol_name (&name); - p = input_line_pointer; unwind.personality_routine = symbol_find_or_make (name); unwind.force_unwind_entry = 1; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); demand_empty_rest_of_line (); } static void dot_proc (int dummy ATTRIBUTE_UNUSED) { - char *name, *p, c; + char *name, c; symbolS *sym; proc_pending *pending, *last_pending; @@ -4240,7 +4239,6 @@ dot_proc (int dummy ATTRIBUTE_UNUSED) { SKIP_WHITESPACE (); c = get_symbol_name (&name); - p = input_line_pointer; if (!*name) as_bad (_("Empty argument of .proc")); else @@ -4261,8 +4259,8 @@ dot_proc (int dummy ATTRIBUTE_UNUSED) } symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION; } - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') break; ++input_line_pointer; @@ -4494,11 +4492,10 @@ dot_endp (int dummy ATTRIBUTE_UNUSED) /* Parse names of main and alternate entry points. */ while (1) { - char *name, *p, c; + char *name, c; SKIP_WHITESPACE (); c = get_symbol_name (&name); - p = input_line_pointer; if (!*name) (md.unwind_check == unwind_check_warning ? as_warn @@ -4518,8 +4515,8 @@ dot_endp (int dummy ATTRIBUTE_UNUSED) if (!sym || !pending) as_warn (_("`%s' was not specified with previous .proc"), name); } - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') break; ++input_line_pointer; @@ -4607,9 +4604,9 @@ dot_rot (int type) { ch = get_symbol_name (&start); len = strlen (ia64_canonicalize_symbol_name (start)); - *input_line_pointer = ch; + restore_line_pointer (ch); - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (*input_line_pointer != '[') { as_bad (_("Expected '['")); @@ -4740,9 +4737,9 @@ dot_psr (int dummy ATTRIBUTE_UNUSED) md.flags |= EF_IA_64_ABI64; else as_bad (_("Unknown psr option `%s'"), option); - *input_line_pointer = ch; + restore_line_pointer (ch); - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') break; @@ -5159,8 +5156,8 @@ dot_entry (int dummy ATTRIBUTE_UNUSED) if (str_hash_insert (md.entry_hash, S_GET_NAME (symbolP), symbolP, 0)) as_bad (_("duplicate entry hint %s"), name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); c = *input_line_pointer; if (c == ',') { @@ -11731,7 +11728,7 @@ dot_alias (int section) delim = get_symbol_name (&name); end_name = input_line_pointer; - *end_name = delim; + restore_line_pointer (delim); if (name == end_name) { @@ -11740,7 +11737,7 @@ dot_alias (int section) return; } - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c index 554c03c..2deb078 100644 --- a/gas/config/tc-m32r.c +++ b/gas/config/tc-m32r.c @@ -1483,8 +1483,8 @@ m32r_scomm (int ignore ATTRIBUTE_UNUSED) /* Just after name is now '\0'. */ p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { as_bad (_("Expected comma after symbol-name: rest of line ignored.")); diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 576ef1f..f4125c1 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -16509,8 +16509,8 @@ s_mips_globl (int x ATTRIBUTE_UNUSED) symbolP = symbol_find_or_make (name); S_SET_EXTERNAL (symbolP); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (!is_end_of_line[(unsigned char) *input_line_pointer] && (*input_line_pointer != ',')) @@ -17569,9 +17569,9 @@ s_mips_weakext (int ignore ATTRIBUTE_UNUSED) c = get_symbol_name (&name); symbolP = symbol_find_or_make (name); S_SET_WEAK (symbolP); - *input_line_pointer = c; + restore_line_pointer (c); - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (! is_end_of_line[(unsigned char) *input_line_pointer]) { diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 8c00d01..4100799 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -2392,8 +2392,8 @@ ppc_elf_lcomm (int xxx ATTRIBUTE_UNUSED) /* Just after name is now '\0'. */ p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { as_bad (_("expected comma after symbol-name: rest of line ignored.")); @@ -2492,8 +2492,8 @@ ppc_elf_localentry (int ignore ATTRIBUTE_UNUSED) elf_symbol_type *elfsym; p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { *p = 0; @@ -5036,8 +5036,8 @@ ppc_ref (int ignore ATTRIBUTE_UNUSED) fix_at_start (symbol_get_frag (ppc_current_csect), 0, symbol_find_or_make (name), 0, false, BFD_RELOC_NONE); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); c = *input_line_pointer; if (c == ',') { diff --git a/gas/config/tc-score7.c b/gas/config/tc-score7.c index e6d98df..fe0fa5e 100644 --- a/gas/config/tc-score7.c +++ b/gas/config/tc-score7.c @@ -5912,7 +5912,7 @@ s7_s_score_lcomm (int bytes_p) c = get_symbol_name (&name); p = input_line_pointer; - *p = c; + restore_line_pointer (c); if (name == p) { @@ -5921,7 +5921,7 @@ s7_s_score_lcomm (int bytes_p) return; } - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); /* Accept an optional comma after the name. The comma used to be required, but Irix 5 cc does not generate it. */ diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index e37189e..bd489d5 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -4119,8 +4119,8 @@ s_reserve (int ignore ATTRIBUTE_UNUSED) c = get_symbol_name (&name); p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { @@ -4246,8 +4246,8 @@ s_common (int ignore ATTRIBUTE_UNUSED) c = get_symbol_name (&name); /* Just after name is now '\0'. */ p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { as_bad (_("Expected comma after symbol-name")); diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c index 0980b2a..6c86b21 100644 --- a/gas/config/tc-tic4x.c +++ b/gas/config/tc-tic4x.c @@ -800,8 +800,8 @@ tic4x_globl (int ignore ATTRIBUTE_UNUSED) { c = get_symbol_name (&name); symbolP = symbol_find_or_make (name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); S_SET_STORAGE_CLASS (symbolP, C_EXT); S_SET_EXTERNAL (symbolP); if (c == ',') diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index e051bb9..deecbb1 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -1573,8 +1573,8 @@ xtensa_literal_pseudo (int ignored ATTRIBUTE_UNUSED) c = get_symbol_name (&base_name); /* Just after name is now '\0'. */ p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',' && *input_line_pointer != ':') { diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c index ca7605e..14b73ef 100644 --- a/gas/dw2gencfi.c +++ b/gas/dw2gencfi.c @@ -1245,8 +1245,8 @@ dot_cfi_sections (int ignored ATTRIBUTE_UNUSED) break; } - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer == ',') { name = input_line_pointer++; diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index 0871c3c..61f774e 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -1326,21 +1326,21 @@ dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED) if (strcmp (p, "basic_block") == 0) { current.flags |= DWARF2_FLAG_BASIC_BLOCK; - *input_line_pointer = c; + restore_line_pointer (c); } else if (strcmp (p, "prologue_end") == 0) { if (dwarf_level < 3) dwarf_level = 3; current.flags |= DWARF2_FLAG_PROLOGUE_END; - *input_line_pointer = c; + restore_line_pointer (c); } else if (strcmp (p, "epilogue_begin") == 0) { if (dwarf_level < 3) dwarf_level = 3; current.flags |= DWARF2_FLAG_EPILOGUE_BEGIN; - *input_line_pointer = c; + restore_line_pointer (c); } else if (strcmp (p, "is_stmt") == 0) { @@ -1442,7 +1442,7 @@ dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED) return; } - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); } demand_empty_rest_of_line (); @@ -1253,8 +1253,8 @@ operand (expressionS *expressionP, enum expr_mode mode) expressionP->X_add_symbol = symbol_lookup_or_make (name, start); expressionP->X_add_number = 0; - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ')') as_bad (_("syntax error in .startof. or .sizeof.")); else @@ -3090,8 +3090,8 @@ s_purgem (int ignore ATTRIBUTE_UNUSED) SKIP_WHITESPACE (); c = get_symbol_name (& name); delete_macro (name); - *input_line_pointer = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); } while (*input_line_pointer++ == ','); @@ -4401,7 +4401,7 @@ s_reloc (int ignore ATTRIBUTE_UNUSED) } else reloc->u.a.howto = bfd_reloc_name_lookup (stdoutput, r_name); - *input_line_pointer = c; + restore_line_pointer (c); if (reloc->u.a.howto == NULL) { as_bad (_("unrecognized reloc type")); @@ -4409,7 +4409,7 @@ s_reloc (int ignore ATTRIBUTE_UNUSED) } exp.X_op = O_absent; - SKIP_WHITESPACE_AFTER_NAME (); + SKIP_WHITESPACE (); if (*input_line_pointer == ',') { ++input_line_pointer; @@ -6528,8 +6528,8 @@ do_s_func (int end_p, const char *default_prefix) delim1 = get_symbol_name (& name); name = xstrdup (name); - *input_line_pointer = delim1; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (delim1); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { if (default_prefix) @@ -37,16 +37,6 @@ extern bool input_from_string; #define SKIP_ALL_WHITESPACE() SKIP_WHITESPACE() #endif -#define SKIP_WHITESPACE_AFTER_NAME() \ - do \ - { \ - if (* input_line_pointer == '"') \ - ++ input_line_pointer; \ - if (* input_line_pointer == ' ') \ - ++ input_line_pointer; \ - } \ - while (0) - #define LEX_NAME (1) /* may continue a name */ #define LEX_BEGIN_NAME (2) /* may begin a name */ #define LEX_END_NAME (4) /* ends a name */ diff --git a/gas/stabs.c b/gas/stabs.c index 00734ff..6542e71 100644 --- a/gas/stabs.c +++ b/gas/stabs.c @@ -453,8 +453,8 @@ s_desc (int ignore ATTRIBUTE_UNUSED) c = get_symbol_name (&name); p = input_line_pointer; - *p = c; - SKIP_WHITESPACE_AFTER_NAME (); + restore_line_pointer (c); + SKIP_WHITESPACE (); if (*input_line_pointer != ',') { *p = 0; |