OSDN Git Service

[WebAssemby] Support main functions with alternate signatures.
authorDan Gohman <dan433584@gmail.com>
Thu, 7 Dec 2017 13:49:27 +0000 (13:49 +0000)
committerDan Gohman <dan433584@gmail.com>
Thu, 7 Dec 2017 13:49:27 +0000 (13:49 +0000)
commit959e37e669b0c3cfad4cb9f1f7c9261ce9f5e9ae
tree1aadace7e992f380160e6e1575b22538b6a19ed3
parent7d3718531c433321dccbb4808822d1078018f8e8
[WebAssemby] Support main functions with alternate signatures.

WebAssembly requires caller and callee signatures to match, so the usual
C runtime trick of calling main and having it just work regardless of
whether main is defined as '()' or '(int argc, char *argv[])' doesn't
work. Extend the FixFunctionBitcasts pass to rewrite main to use the
latter form.

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