[PATCH] D133057: [WebAssembly][MC] Improve error handling on empty function declarations

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 06:19:05 PDT 2022


sbc100 added a comment.

In D133057#3762475 <https://reviews.llvm.org/D133057#3762475>, @dschuff wrote:

> IIUC in other asm formats, you can just e.g. switch to the data section (in the middle of generating code for a function), emit a data constant, and then switch back and finish the function. In theory we could do that for wasm too, as long as we do actually switch back and finish the function. but I get that would make this error checking a lot more complicated, and I don't know of any cases where we would actually want to do that. do you?

I looked into this and I think we already can't support this type of thing in the general case due to the way to type checking works.

For example there is global state in the type checker that assumes that only one function is parsed at a time.  If you could emit part of one function then part of another, then switch back to the original, that would break the type checker.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133057/new/

https://reviews.llvm.org/D133057



More information about the llvm-commits mailing list