[WebAssembly] Relax signature checking for undefined functions that are not called directly

When function signatures don't match and the undefined function is not
called directly (i.e. only has its address taken) we don't issue a
warning or create a runtime thunk for the undefined function.

Instead in this case we simply use the defined version of the function.
This is possible since checking signatures of dynamic calls happens
at runtime so any invalid usage will still result in a runtime error.

This is needed to allow C++ programs to link without generating
warnings.  Its not uncommon in C++ for vtables to be populated by
function address whee the signature of the function is not known in the
compilation unit.  In this case clang declares the method as void(void)
and relies on the vtable caller casting the data back to the correct

Fixes: https://bugs.llvm.org/show_bug.cgi?id=40412

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

llvm-svn: 361678
7 files changed
tree: 513c1f708555b856fffe5824955237f53246aceb
  1. .arcconfig
  2. .clang-format
  3. .clang-tidy
  4. .gitignore
  5. README.md
  6. clang-tools-extra/
  7. clang/
  8. compiler-rt/
  9. debuginfo-tests/
  10. libclc/
  11. libcxx/
  12. libcxxabi/
  13. libunwind/
  14. lld/
  15. lldb/
  16. llgo/
  17. llvm/
  18. openmp/
  19. parallel-libs/
  20. polly/
  21. pstl/

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.