diff options
author | Heejin Ahn <aheejin@gmail.com> | 2018-05-31 22:02:34 +0000 |
---|---|---|
committer | Heejin Ahn <aheejin@gmail.com> | 2018-05-31 22:02:34 +0000 |
commit | 99d60e0dabcf20f4db683da83cde905b7a1373de (patch) | |
tree | 0f0ea16dbb9884dcc2ee2ac8418ae579b4718c96 /llvm/lib/CodeGen/TargetPassConfig.cpp | |
parent | 2ae1ab30e378ae982d6e6b00aefedd84a00c9b29 (diff) | |
download | bcm5719-llvm-99d60e0dabcf20f4db683da83cde905b7a1373de.tar.gz bcm5719-llvm-99d60e0dabcf20f4db683da83cde905b7a1373de.zip |
[WebAssembly] Add Wasm exception handling prepare pass
Summary:
This adds a pass that transforms a program to be prepared for Wasm
exception handling. This is using Windows EH instructions and based on
the previous Wasm EH proposal.
(https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md)
Reviewers: dschuff, majnemer
Subscribers: jfb, mgorny, sbc100, jgravelle-google, JDevlieghere, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D43746
llvm-svn: 333696
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetPassConfig.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index 46152aa09e8..8c5bdde888e 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -656,7 +656,12 @@ void TargetPassConfig::addPassesToHandleExceptions() { addPass(createDwarfEHPass()); break; case ExceptionHandling::Wasm: - // TODO to prevent warning + // Wasm EH uses Windows EH instructions, but it does not need to demote PHIs + // on catchpads and cleanuppads because it does not outline them into + // funclets. Catchswitch blocks are not lowered in SelectionDAG, so we + // should remove PHIs there. + addPass(createWinEHPass(/*DemoteCatchSwitchPHIOnly=*/false)); + addPass(createWasmEHPass()); break; case ExceptionHandling::None: addPass(createLowerInvokePass()); |