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

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 14:23:47 PDT 2022


dschuff added a comment.

I was actually thinking about something like the following:

  foo:
    .functype foo (i32) -> ()
    local.get 0
  
  .section .data.bar,"",@
  bar:
    .int32 7
    .size bar, 4
  
  .section .text.foo,"",@
    drop
    end_function

It looks like that does actually work today. (if you delete the `drop` you'll even get the right type check failure.
But still, I'm not sure how valuable it is. I wonder how we'd find out.

BTW, do you have any idea how close we are to being able to round trip some clang test suite through asm rather than directly emitting objects? That would at least tell us whether clang ever does this.
edit: I had wondered whether clang used e.g. .pushsection/.popsection which would make this even easier to write. but it looks like we don't actually even support .pushsection


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