-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[WebAssembly] Remove wasm-specific findWasmUnwindDestinations #130374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -1850,13 +1850,12 @@ bool WebAssemblyCFGStackify::fixCallUnwindMismatches(MachineFunction &MF) { | |||||||
|
||||||||
// If the EH pad on the stack top is where this instruction should unwind | ||||||||
// next, we're good. | ||||||||
MachineBasicBlock *UnwindDest = getFakeCallerBlock(MF); | ||||||||
MachineBasicBlock *UnwindDest = nullptr; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drive-by NFC fix. Fake caller block is used not here but somewhere below, and this part of the code cannot be entered when there is no EH pad successor: llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp Lines 1846 to 1848 in ab87206
which will be assigned to UnwindDest below, so this has no meaning other than creating a may-not-be-necessary BB.
|
||||||||
for (auto *Succ : MBB.successors()) { | ||||||||
// Even though semantically a BB can have multiple successors in case an | ||||||||
// exception is not caught by a catchpad, in our backend implementation | ||||||||
// it is guaranteed that a BB can have at most one EH pad successor. For | ||||||||
// details, refer to comments in findWasmUnwindDestinations function in | ||||||||
// SelectionDAGBuilder.cpp. | ||||||||
// exception is not caught by a catchpad, the first unwind destination | ||||||||
// should appear first in the successor list, based on the calculation | ||||||||
// in findUnwindDestinations() in SelectionDAGBuilder.cpp. | ||||||||
if (Succ->isEHPad()) { | ||||||||
UnwindDest = Succ; | ||||||||
break; | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the comment on line 2059 above should be updated too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done