[WebAssembly] Don't create bitcast-wrappers for varargs.

WebAssembly varargs functions use a significantly different ABI than
non-varargs functions, and the current code in
WebAssemblyFixFunctionBitcasts doesn't handle that difference. For now,
just avoid creating wrapper functions in the presence of varargs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292645 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2017-01-20 20:50:29 +00:00
parent 85b2e0b34b
commit 0d4e33d211
2 changed files with 22 additions and 0 deletions
@@ -148,6 +148,11 @@ bool FixFunctionBitcasts::runOnModule(Module &M) {
if (!Ty)
continue;
// Wasm varargs are not ABI-compatible with non-varargs. Just ignore
// such casts for now.
if (Ty->isVarArg() || F->isVarArg())
continue;
auto Pair = Wrappers.insert(std::make_pair(std::make_pair(F, Ty), nullptr));
if (Pair.second)
Pair.first->second = CreateWrapper(F, Ty);