summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-07-11 04:29:36 +0000
committerSam Clegg <sbc@chromium.org>2018-07-11 04:29:36 +0000
commit92617559bbb432e45efb462658020529c1ac9237 (patch)
tree9396043b7c9da1e1fc1df8b78e2329a4c2163df1 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
parentfcd1b66ae10520b2189df03405f7bfac687b3e70 (diff)
downloadbcm5719-llvm-92617559bbb432e45efb462658020529c1ac9237.tar.gz
bcm5719-llvm-92617559bbb432e45efb462658020529c1ac9237.zip
[WebAssembly] Add pass to infer prototypes for prototype-less functions
See https://bugs.llvm.org/show_bug.cgi?id=35385 Differential Revision: https://reviews.llvm.org/D48471 llvm-svn: 336759
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
index 02810d71b70..9a5f459e9dd 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
@@ -51,6 +51,7 @@ extern "C" void LLVMInitializeWebAssemblyTarget() {
// Register backend passes
auto &PR = *PassRegistry::getPassRegistry();
+ initializeWebAssemblyAddMissingPrototypesPass(PR);
initializeWebAssemblyLowerEmscriptenEHSjLjPass(PR);
initializeLowerGlobalDtorsPass(PR);
initializeFixFunctionBitcastsPass(PR);
@@ -214,6 +215,9 @@ void WebAssemblyPassConfig::addIRPasses() {
addPass(createAtomicExpandPass());
}
+ // Add signatures to prototype-less function declarations
+ addPass(createWebAssemblyAddMissingPrototypes());
+
// Lower .llvm.global_dtors into .llvm_global_ctors with __cxa_atexit calls.
addPass(createWebAssemblyLowerGlobalDtors());
OpenPOWER on IntegriCloud