mes/module/mescc
Ekaitz Zarraga 47cffc5d2a mescc: Fix switch statements' fallthrough
Flattens case structures as nyacc is giving consecutive cases as a
nested block like:

    (case testA
      (case testB
        (case testC BODY)))

We convert to:

    ((case testA (expr-stmt))
     (case testB (expr-stmt))
     (case testC BODY))

And then treat them as independent cases. For the fallthrough we just
add a jump to each case's body right before its clause (each of the case
blocks is responsible of adding its own jump to its body):

        // This doesn't have it because it's the first
    CASE1:
        testA
    CASE1_BODY:

        goto CASE2_BODY
    CASE2:
        testB
    CASE2_BODY:

        goto CASE3_BODY
    CASE3:
        testB
    CASE3_BODY:

This enables complex fallthrough schemes comparing to what was done
before.

* module/mescc/compile.scm (ast->info)[switch]{flatten-cases}: New
variable.
(ast->info)[switch]{statements}: Use flatten-cases on it.
(switch->expr): Remove unneeded matchers and add jumps to body.
* build-aux/check-mescc.sh(xfail-tests): Remove
lib/tests/scaffold/66-local-char-array.c.
2023-11-05 09:45:31 +01:00
..
armv4 mescc: Add support for signed rotation. 2023-11-05 09:45:31 +01:00
i386 mescc: Add support for signed rotation. 2023-11-05 09:45:31 +01:00
riscv64 mescc: Add support for signed rotation. 2023-11-05 09:45:31 +01:00
x86_64 mescc: Add support for signed rotation. 2023-11-05 09:45:31 +01:00
as.scm mescc: x86_64 support: Refactor to abstracted assembly, add x86_64. 2018-08-15 18:26:55 +02:00
bytevectors.scm mescc: x86_64 support: Refactor to abstracted assembly, add x86_64. 2018-08-15 18:26:55 +02:00
compile.scm mescc: Fix switch statements' fallthrough 2023-11-05 09:45:31 +01:00
info.scm mescc: Do not dump variables with extern storage. 2019-07-27 17:22:00 +02:00
M1.scm riscv64: Port to word based mescc-tools. 2023-11-05 09:40:38 +01:00
mescc.scm mescc: RISC-V64 code generation. 2023-11-05 09:40:37 +01:00
preprocess.scm mescc: Remove duplicate include. 2023-08-27 10:05:33 +02:00