[all-commits] [llvm/llvm-project] 69577b: [WebAssembly] Support type checker for new EH (#11...

Heejin Ahn via All-commits all-commits at lists.llvm.org
Mon Oct 7 10:29:48 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 69577b2454fcfe35d562ede90c15150f7265376a
      https://github.com/llvm/llvm-project/commit/69577b2454fcfe35d562ede90c15150f7265376a
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2024-10-07 (Mon, 07 Oct 2024)

  Changed paths:
    M llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
    M llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.h
    M llvm/test/MC/WebAssembly/annotations.s
    M llvm/test/MC/WebAssembly/eh-assembly.s
    M llvm/test/MC/WebAssembly/type-checker-errors.s

  Log Message:
  -----------
  [WebAssembly] Support type checker for new EH (#111069)

This adds supports for the new EH instructions (`try_table` and
`throw_ref`) to the type checker.

One thing I'd like to improve on is the locations in the errors for
`catch_***` clauses. Currently they just point to the starting column of
`try_table` instruction itself. But to figure out where catch clauses
start you need to traverse `OperandVector` and check
`WebAssemblyOperand::isCatchList` on them to see which one is the catch
list operand, but `WebAssemblyOperand` class is in AsmParser and
AsmTypeCheck does not have access to it:

https://github.com/llvm/llvm-project/blob/cdfdc857cbab0418b7e5116fd4255eb5566588bd/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp#L43-L204
And even if AsmTypeCheck has access to it, currently it treats the list
of catch clauses as a single `WebAssemblyOperand` so there is no way to
get the starting location of each `catch_***` clause in the current
structure.

This also renames `valTypeToStackType` to `valTypesToStackTypes`, given
that it takes two type lists.



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