[all-commits] [llvm/llvm-project] b62075: [WebAssembly] Allow AsmTypeCheck detect multiple e...
Heejin Ahn via All-commits
all-commits at lists.llvm.org
Tue Sep 24 16:56:45 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b62075e0290b5fd626e49cb901b8bc4ac09fdd60
https://github.com/llvm/llvm-project/commit/b62075e0290b5fd626e49cb901b8bc4ac09fdd60
Author: Heejin Ahn <aheejin at gmail.com>
Date: 2024-09-24 (Tue, 24 Sep 2024)
Changed paths:
M llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
M llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.h
M llvm/test/MC/WebAssembly/type-checker-errors.s
Log Message:
-----------
[WebAssembly] Allow AsmTypeCheck detect multiple errors in function (#109705)
This allows multiple errors to be reported within a function, rather
than returning on the first error and not looking at the rest of the
function.
I think the rationale for the previous behavior was that upon
encountering the first error, the value stack was not in the correct
status anymore and the rest of the function checking was not very
meaningful. But this patch makes the instruction push the correct result
type upon its completion, so the while the possibility of previous error
affecting later instructions is not zero, I think this can be more
helpful to assembly hand-writers. This also allows us to write multiple
error test cases without creating as many functions.
This is what Wabt and Binaryen wast checker/validator do as well.
Also this makes sure we return a value (true/false) within an `if` for
each instruction, removing the need for the long `if`-`else if`-`else
if` chain and making them all just `if`s. I also added newlines between
the `if`s, which I feel is easier to read.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list