[WebAssembly] Preserve function signatures during LTO
authorSam Clegg <sbc@chromium.org>
Fri, 28 Sep 2018 16:50:14 +0000 (16:50 +0000)
committerSam Clegg <sbc@chromium.org>
Fri, 28 Sep 2018 16:50:14 +0000 (16:50 +0000)
commit8b0b48f343cb0347e266f8b551425e5fa21ce948
tree75136cd60fb06efd2a4dd21af92524c6720ed2c0
parente42a8ecf660b1244b1b573007c2fbf70042e02a4
[WebAssembly] Preserve function signatures during LTO

With LTO when and undefined function (with a known signature)
in replaced by a defined bitcode function we were loosing the
signature information (since bitcode functions don't have
signatures).

With this change we preserve the original signature from the
undefined function and verify that the post LTO compiled
function has the correct signature.

This change improves the error handling in the case where
there is a signature mismatch with a function defined in
a bitcode file.

Differential Revision: https://reviews.llvm.org/D50721

llvm-svn: 343340
lld/test/wasm/lto/signature-mismatch.ll [new file with mode: 0644]
lld/wasm/LTO.cpp
lld/wasm/SymbolTable.cpp