mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-02 03:49:45 -06:00
This patch adds more data definition directives to be recognized by `AsmParser` in lib/parsers/asm-parser.ts. Fixes #5489, as well as inappropriate filtering of `.double` directives in test/filter-cases/diab.asm which is similar to #5489. The list of data directives are taken from the "Assembler Directives" chapter of the [GNU `as` manual][as]. Directives added by this patch are: - `.dc[size]` - `.dcb[size]` - `.ds[size]` - `.double` - `.fill` - `.float` - `.int` - `.single` - `.skip` - `.space` - `.string8`, `.string16`, `.string32`, `.string64` The `.space` directive is not a data directive when assembling for the HPPA architecture; this must be fixed if HPPA support is to be added to Compiler Explorer. Some of the directives such as `.string64` are pretty unlikely to be emitted by actual compilers, but we add them because it can't break existing input (no `as`-compatible compiler can use them as non-data directives), and will futureproof us against future compilers that do emit them. Architecture-specific directives documented in the "Machine Dependent Features" chapter are not added in this patch, even though it may be better to add some of them (such as `.stringz`) as well. Existing directives that are not found on the "Assembler Directives" list are not removed. `.sleb128` and `.uleb128` are technically data directives, but aren't added because we assume they're only used in debuginfo. [as]: https://sourceware.org/binutils/docs-2.41/as/index.html <!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE IT Thanks for taking the time to improve CE. We really appreciate it. Before opening the PR, please make sure that the tests & linter pass their checks, by running `make check`. In the best case scenario, you are also adding tests to back up your changes, but don't sweat it if you don't. We can discuss them at a later date. Feel free to append your name to the CONTRIBUTORS.md file Thanks again, we really appreciate this! -->