llvm-project/llvm/lib/Target/WebAssembly/MCTargetDesc
Derek Schuff 5859a9ed80 [WebAssembly] Emit type signatures for declared functions
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.

Differential Revision: http://reviews.llvm.org/D20891

Re-apply r271599 but instead of bailing with an error when a declared
function has multiple returns, replace it with a pointer argument. Also
add the test case I forgot to 'git add' last time around.

llvm-svn: 271703
2016-06-03 18:34:36 +00:00
..
CMakeLists.txt [WebAssembly] Introduce a WebAssemblyTargetStreamer class. 2016-01-12 20:30:51 +00:00
LLVMBuild.txt
WebAssemblyAsmBackend.cpp [WebAssembly] Add an assertion to catch unexpected MCFixupKindInfo flags. 2016-01-13 19:31:57 +00:00
WebAssemblyELFObjectWriter.cpp WebAssembly: fix build break introduced by ELFObjectWriter churn 2016-01-13 23:36:00 +00:00
WebAssemblyMCAsmInfo.cpp [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
WebAssemblyMCAsmInfo.h [WebAssembly] Switch WebAssemblyMCAsmInfo.h from MCAsmInfo to MCAsmInfoELF. 2015-12-17 20:50:45 +00:00
WebAssemblyMCCodeEmitter.cpp [WebAssembly] Minor code cleanups. NFC. 2016-01-20 05:54:22 +00:00
WebAssemblyMCTargetDesc.cpp [WebAssembly] Disable register stackification and coloring when not optimizing 2016-02-17 23:20:43 +00:00
WebAssemblyMCTargetDesc.h [WebAssembly] Implement support for custom NaN bit patterns. 2016-02-16 15:14:23 +00:00
WebAssemblyTargetStreamer.cpp [WebAssembly] Emit type signatures for declared functions 2016-06-03 18:34:36 +00:00
WebAssemblyTargetStreamer.h [WebAssembly] Emit type signatures for declared functions 2016-06-03 18:34:36 +00:00