]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas: have scrubber retain more whitespace
authorJan Beulich <jbeulich@suse.com>
Fri, 9 Aug 2024 09:59:31 +0000 (11:59 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 9 Aug 2024 09:59:31 +0000 (11:59 +0200)
commit6ae8a30d44f016cafb46a75843b5109316eb1996
tree3043cc5b62038e700957a8ed3671ec7c7a1dc36f
parenteb2b444321416f5bb98286647ee9769dfee5995d
gas: have scrubber retain more whitespace

According to the description of the state machine, the expectation
appears to be that (leaving aside labels) any insn mnemonic or
directive would be followed by a comma separated list of operands. That
may have been true very long ago, but the latest with the advent of more
elaborate macros this isn't rhe case anymore. Neither macro parameters
in macro definitions nor macro arguments in macro invocations are
required to be separated by commas. Hence whitespace serves a crucial
role there. Plus even without "real" macros issues exist, in e.g.

.irp n, ...
insn\n\(suffix) operand1, operand2
.endr

Whitespace following the closing parenthesis would have been removed
(ahead of even processing the .irp), as the "opcode" was deemed to have
ended earlier already.

Therefore, squash the distinction between "opcode" and operands, i.e.
fold state 10 back into state 3. Also drop most of the distinction
between "symbol chars" and "relatively normal" ones. Not entirely
unexpectedly this results in the need to skip whitespace in a few more
places in arch-specific code (and quite likely more changes are needed
for insn forms not covered by the testsuite).

As a result the D10V special case is no longer necessary.

In config/tc-sparc.c also move a comment to be next to the code being
commented.

In opcodes/cgen-asm.in some further cleanup is done, following the local
var adjustments.
26 files changed:
gas/NEWS
gas/app.c
gas/config/tc-aarch64.c
gas/config/tc-arm.c
gas/config/tc-crx.c
gas/config/tc-csky.c
gas/config/tc-pru.c
gas/config/tc-sparc.c
gas/config/tc-v850.c
gas/testsuite/gas/all/macro.l
gas/testsuite/gas/all/macro.s
gas/testsuite/gas/i386/x86-64-apx-nf.s
opcodes/cgen-asm.in
opcodes/epiphany-asm.c
opcodes/fr30-asm.c
opcodes/frv-asm.c
opcodes/ip2k-asm.c
opcodes/iq2000-asm.c
opcodes/lm32-asm.c
opcodes/m32c-asm.c
opcodes/m32r-asm.c
opcodes/mep-asm.c
opcodes/mt-asm.c
opcodes/nds32-asm.c
opcodes/or1k-asm.c
opcodes/xstormy16-asm.c