[PATCH] D20891: [WebAssembly] Emit type signatures for declared functions

Derek Schuff via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 16:54:43 PDT 2016


dschuff created this revision.
dschuff added a reviewer: sunfish.
dschuff added a subscriber: llvm-commits.
Herald added subscribers: dschuff, jfb.

Under emscripten, C code can take the address of a function implemented
in Javascript (which is exposed via an import in wasm). Because imports
do not have linear memory address in wasm, we need to generate a thunk
to be the target of the indirect call; it call the import directly.

To make this possible, LLVM needs to emit the type signatures for these
functions, because they may not be called directly or referred to other
than where the address is taken.

This uses s new .s directive (.functype) which specifies the signature.

http://reviews.llvm.org/D20891

Files:
  lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.cpp
  lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h
  lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
  test/CodeGen/WebAssembly/indirect-import.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20891.59310.patch
Type: text/x-patch
Size: 7576 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160601/ea03cde9/attachment.bin>


More information about the llvm-commits mailing list