summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2018-08-21 20:04:42 +0000
committerHeejin Ahn <aheejin@gmail.com>2018-08-21 20:04:42 +0000
commit9cd7f88a35cbcaa51ca2c6eb02be31cca2a6d8cc (patch)
treec5396185e81be86bb26713229aebc7fa67c2cb1e /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parent20c9c4438e77429499666f832927ac4b74f06835 (diff)
downloadbcm5719-llvm-9cd7f88a35cbcaa51ca2c6eb02be31cca2a6d8cc.tar.gz
bcm5719-llvm-9cd7f88a35cbcaa51ca2c6eb02be31cca2a6d8cc.zip
[WebAssembly] Don't make wasm cleanuppads into funclet entries
Summary: Catchpads and cleanuppads are not funclet entries; they are only EH scope entries. We already dont't set `isEHFuncletEntry` for catchpads. This patch does the same thing for cleanuppads. Reviewers: dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D50654 llvm-svn: 340330
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 9ae5b3c6590..896aed04744 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -1437,8 +1437,11 @@ void SelectionDAGBuilder::visitCleanupPad(const CleanupPadInst &CPI) {
// Don't emit any special code for the cleanuppad instruction. It just marks
// the start of an EH scope/funclet.
FuncInfo.MBB->setIsEHScopeEntry();
- FuncInfo.MBB->setIsEHFuncletEntry();
- FuncInfo.MBB->setIsCleanupFuncletEntry();
+ auto Pers = classifyEHPersonality(FuncInfo.Fn->getPersonalityFn());
+ if (Pers != EHPersonality::Wasm_CXX) {
+ FuncInfo.MBB->setIsEHFuncletEntry();
+ FuncInfo.MBB->setIsCleanupFuncletEntry();
+ }
}
/// When an invoke or a cleanupret unwinds to the next EH pad, there are
@@ -1458,6 +1461,7 @@ static void findUnwindDestinations(
classifyEHPersonality(FuncInfo.Fn->getPersonalityFn());
bool IsMSVCCXX = Personality == EHPersonality::MSVC_CXX;
bool IsCoreCLR = Personality == EHPersonality::CoreCLR;
+ bool IsWasmCXX = Personality == EHPersonality::Wasm_CXX;
bool IsSEH = isAsynchronousEHPersonality(Personality);
while (EHPadBB) {
@@ -1472,7 +1476,8 @@ static void findUnwindDestinations(
// personalities.
UnwindDests.emplace_back(FuncInfo.MBBMap[EHPadBB], Prob);
UnwindDests.back().first->setIsEHScopeEntry();
- UnwindDests.back().first->setIsEHFuncletEntry();
+ if (!IsWasmCXX)
+ UnwindDests.back().first->setIsEHFuncletEntry();
break;
} else if (auto *CatchSwitch = dyn_cast<CatchSwitchInst>(Pad)) {
// Add the catchpad handlers to the possible destinations.
OpenPOWER on IntegriCloud