Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2141,25 +2141,13 @@ bool WebAssemblyCFGStackify::fixCatchUnwindMismatches(MachineFunction &MF) {

for (auto &MBB : reverse(MF)) {
for (auto &MI : reverse(MBB)) {
if (MI.getOpcode() == WebAssembly::TRY)
if (WebAssembly::isTry(MI.getOpcode())) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added braces for consistency.

EHPadStack.pop_back();
else if (MI.getOpcode() == WebAssembly::TRY_TABLE) {
// We want to exclude try_tables created in fixCallUnwindMismatches.
// Check if the try_table's unwind destination matches the EH pad stack
// top. If it is created in fixCallUnwindMismatches, it wouldn't.
if (getSingleUnwindDest(&MI) == EHPadStack.back())
EHPadStack.pop_back();
} else if (MI.getOpcode() == WebAssembly::DELEGATE)
} else if (MI.getOpcode() == WebAssembly::DELEGATE) {
EHPadStack.push_back(&MBB);
else if (WebAssembly::isCatch(MI.getOpcode())) {
} else if (WebAssembly::isCatch(MI.getOpcode())) {
auto *EHPad = &MBB;

// If the BB has a catch pseudo instruction but is not marked as an EH
// pad, it's a trampoline BB we created in fixCallUnwindMismatches. Skip
// it.
if (!EHPad->isEHPad())
continue;

// catch_all always catches an exception, so we don't need to do
// anything
if (WebAssembly::isCatchAll(MI.getOpcode())) {
Expand Down
Loading