aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyLowerBrUnless.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2024-09-24 16:56:24 -0700
committerGitHub <noreply@github.com>2024-09-24 16:56:24 -0700
commitb62075e0290b5fd626e49cb901b8bc4ac09fdd60 (patch)
tree44a952cedb60d0ee93585e6d84f4ec06e8124e18 /llvm/lib/Target/WebAssembly/WebAssemblyLowerBrUnless.cpp
parentbde2357f71dfd0ab9921d7e1a5d1ae12d8c44305 (diff)
downloadllvm-b62075e0290b5fd626e49cb901b8bc4ac09fdd60.zip
llvm-b62075e0290b5fd626e49cb901b8bc4ac09fdd60.tar.gz
llvm-b62075e0290b5fd626e49cb901b8bc4ac09fdd60.tar.bz2
[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.
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyLowerBrUnless.cpp')
0 files changed, 0 insertions, 0 deletions