diff options
author | Heejin Ahn <aheejin@gmail.com> | 2016-08-31 22:40:34 +0000 |
---|---|---|
committer | Heejin Ahn <aheejin@gmail.com> | 2016-08-31 22:40:34 +0000 |
commit | 23d57103a47c8cd9be764ae85fa2b52217069836 (patch) | |
tree | 303689123cbf8ec82c8d59c4a72278d3464d0849 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | |
parent | 109448ee8140072751d061821cfaea3415f67c02 (diff) | |
download | bcm5719-llvm-23d57103a47c8cd9be764ae85fa2b52217069836.tar.gz bcm5719-llvm-23d57103a47c8cd9be764ae85fa2b52217069836.zip |
Add asm.js-style setjmp/longjmp handling for wasm
Summary: This patch adds asm.js-style setjmp/longjmp handling support for WebAssembly. It also uses JavaScript's try and catch mechanism.
Reviewers: jpp, dschuff
Subscribers: jfb, dschuff
Differential Revision: https://reviews.llvm.org/D23928
llvm-svn: 280302
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp index 3aa25932f84..66976a77892 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp @@ -165,7 +165,14 @@ void WebAssemblyPassConfig::addIRPasses() { if (getOptLevel() != CodeGenOpt::None) addPass(createWebAssemblyOptimizeReturned()); - // Handle exceptions. + // If exception handling is not enabled, we lower invokes into calls and + // simplify CFG to delete unreachable landingpad blocks. + if (!EnableEmException) { + addPass(createLowerInvokePass()); + addPass(createCFGSimplificationPass()); + } + + // Handle exceptions and setjmp/longjmp if enabled. if (EnableEmException || EnableEmSjLj) addPass(createWebAssemblyLowerEmscriptenEHSjLj(EnableEmException, EnableEmSjLj)); |