From 78c19d60a97fa6c7d3854827ec647f88e48904b4 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 30 Nov 2017 18:16:49 +0000 Subject: [WebAssembly] Revert r319186 "Support bitcasted function addresses with varargs." The patch broke Emscripten's EM_ASM macros, which utiltize unprototyped functions. See https://bugs.llvm.org/show_bug.cgi?id=35385 for details. llvm-svn: 319452 --- llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib') diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp index 6473a2bfb59..f1d2c00d163 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp @@ -162,6 +162,11 @@ bool FixFunctionBitcasts::runOnModule(Module &M) { if (!Ty) continue; + // Bitcasted vararg functions occur in Emscripten's implementation of + // EM_ASM, so suppress wrappers for them 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); -- cgit v1.2.3