OSDN Git Service

[WebAssembly] Don't error on conflicting uses of prototype-less functions
authorSam Clegg <sbc@chromium.org>
Wed, 20 Feb 2019 22:40:57 +0000 (22:40 +0000)
committerSam Clegg <sbc@chromium.org>
Wed, 20 Feb 2019 22:40:57 +0000 (22:40 +0000)
commit6b17ef5b05a5d82b5c3ba0f265264eab38f712ae
tree532929a0651e43a8106847a4f2d403d0dd74dc46
parente890ea0ea2491ca4c5f44f5ff057e2e26c4f15d6
[WebAssembly] Don't error on conflicting uses of prototype-less functions

When we can't determine with certainty the signature of a function
import we pick the fist signature we find rather than error'ing out.

The resulting program might not do what is expected since we might pick
the wrong signature.  However since undefined behavior in C to use the
same function with different signatures this seems better than refusing
to compile such programs.

Fixes PR40472

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354523 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/WebAssemblyAddMissingPrototypes.cpp
test/CodeGen/WebAssembly/add-prototypes-conflit.ll [new file with mode: 0644]