[all-commits] [llvm/llvm-project] 1753d1: [WebAssembly] Print instructions with type checkin...

Heejin Ahn via All-commits all-commits at lists.llvm.org
Thu Oct 3 17:32:51 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1753d169d5a650a29c4bb01940048a5c6c7871c4
      https://github.com/llvm/llvm-project/commit/1753d169d5a650a29c4bb01940048a5c6c7871c4
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2024-10-03 (Thu, 03 Oct 2024)

  Changed paths:
    M llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
    A llvm/test/MC/WebAssembly/annotations-typecheck.s

  Log Message:
  -----------
  [WebAssembly] Print instructions with type checking errors (#111067)

When there was a type checking error, we didn't run `InstPrinter`. This
can be confusing because when there is an error in, say, block parameter
type, `InstPrinter` doesn't run even if it has nothing to do with block
parameter types, and all those updates to `ControlFlowStack` or
`TryStack` do not happen:

https://github.com/llvm/llvm-project/blob/c20b90ab8557b38efe8e8e993d41d8c08b798267/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.cpp#L135-L151

For example,
```wast
block (i32) -> () ;; Block input parameter error
end_block         ;; Now this errors out as "End marker mismatch"
```
This is confusing because there is a `block` and the `end_block` is not
a mismatch. Only that `block` has a type checking error, but that's not
an end marker mismatch.

I think we can just print the instruction whether we had a type checking
error or not, and this will be less confusing.



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