diff options
author | Heejin Ahn <aheejin@gmail.com> | 2020-01-23 16:39:32 -0800 |
---|---|---|
committer | Hans Wennborg <hans@chromium.org> | 2020-01-29 21:55:38 +0100 |
commit | d18ccb8b3310867c179f22704b6397e83981fff7 (patch) | |
tree | b9b69f0ebffd53094d7352538204c37c50ce577b /llvm/lib | |
parent | 92edb295392dea9c7f545f180065292459ebe4e9 (diff) | |
download | bcm5719-llvm-d18ccb8b3310867c179f22704b6397e83981fff7.tar.gz bcm5719-llvm-d18ccb8b3310867c179f22704b6397e83981fff7.zip |
[WebAssembly] Fix resume-only case in Emscripten EH
Summary:
D72308 incorrectly assumed `resume` cannot exist without a `landingpad`,
which is not true. This sets `Changed` to true whenever we make changes
to a function, including creating a call to `__resumeException` within a
function without a landing pad.
Reviewers: tlively
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73308
(cherry picked from commit 580d7838dd08e13dac6caf4ab3142c9381bc7ad0)
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp index d1f3acbd221..3e905c18fa3 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp @@ -751,6 +751,7 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runEHOnFunction(Function &F) { auto *II = dyn_cast<InvokeInst>(BB.getTerminator()); if (!II) continue; + Changed = true; LandingPads.insert(II->getLandingPadInst()); IRB.SetInsertPoint(II); @@ -791,6 +792,7 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runEHOnFunction(Function &F) { auto *RI = dyn_cast<ResumeInst>(&I); if (!RI) continue; + Changed = true; // Split the input into legal values Value *Input = RI->getValue(); @@ -815,6 +817,7 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runEHOnFunction(Function &F) { continue; if (Callee->getIntrinsicID() != Intrinsic::eh_typeid_for) continue; + Changed = true; IRB.SetInsertPoint(CI); CallInst *NewCI = @@ -830,7 +833,7 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runEHOnFunction(Function &F) { if (auto *LPI = dyn_cast<LandingPadInst>(I)) LandingPads.insert(LPI); } - Changed = !LandingPads.empty(); + Changed |= !LandingPads.empty(); // Handle all the landingpad for this function together, as multiple invokes // may share a single lp |