diff options
author | Heejin Ahn <aheejin@gmail.com> | 2020-01-06 16:15:53 -0800 |
---|---|---|
committer | Heejin Ahn <aheejin@gmail.com> | 2020-01-06 17:02:32 -0800 |
commit | 21f7b362095f7497aa87ccc334fe18bbc072854c (patch) | |
tree | ab70010960c34574811698e8da6d2a41e2522659 /llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp | |
parent | 52afc93c38c4dc6071172e2f580d364592d92dda (diff) | |
download | bcm5719-llvm-21f7b362095f7497aa87ccc334fe18bbc072854c.tar.gz bcm5719-llvm-21f7b362095f7497aa87ccc334fe18bbc072854c.zip |
[WebAssembly] Fix landingpad-only case in Emscripten EH
Summary:
Previously we didn't set `Changed` to true when there are only landing
pads but not invokes. This fixes it and we set `Changed` to true
whenever we have landing pads. (There can't be invokes without landing
pads, so that case is covered too)
The test case for this has to be a separate file because this pass is a
`ModulePass` and `Changed` is computed based on the whole module.
Reviewers: tlively
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72308
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp index f34c27ced56..6179b71c76c 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp @@ -751,7 +751,6 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runEHOnFunction(Function &F) { auto *II = dyn_cast<InvokeInst>(BB.getTerminator()); if (!II) continue; - Changed = true; LandingPads.insert(II->getLandingPadInst()); IRB.SetInsertPoint(II); @@ -831,6 +830,7 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runEHOnFunction(Function &F) { if (auto *LPI = dyn_cast<LandingPadInst>(I)) LandingPads.insert(LPI); } + Changed = !LandingPads.empty(); // Handle all the landingpad for this function together, as multiple invokes // may share a single lp |