[PATCH] D118122: [WebAssembly] Refactor and fix emission of external IR global decls

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 12:24:45 PST 2022


sbc100 added a comment.

The emscripten breakage appears to be related to missing function types when function are only references in static data.  For example musl's stderr.c: https://github.com/emscripten-core/emscripten/blob/6754be32129e9392a2d1f684a1d02172cda0d640/system/lib/libc/musl/src/stdio/stderr.c#L12-L14

Without this change __stdio_close/seek/write get `.function_type` directives and with this change they don't.    i.e. These lines are missing after this change:

  	.functype	__stdio_close (i32) -> (i32)
  	.functype	__stdio_write (i32, i32, i32) -> (i32)
  	.functype	__stdio_seek (i32, i64, i32) -> (i64)

I'm guessing this is because this translation unit contains no functions.. only data.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118122



More information about the llvm-commits mailing list