Terminate pads, cleanup pads with __clang_call_terminate call, have
catch instruction in them because __clang_call_terminate takes an
exception pointer. But these terminate pads should be reached also in
case of foreign exception. So this pass attaches an additional
catch_all BB after every terminate pad BB, with a call to
std::terminate.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM besides that one comment!
llvm/lib/Target/WebAssembly/WebAssemblyHandleEHTerminatePads.cpp | ||
---|---|---|
126 | Is it possible for one BB to contain multiple calls to __clang_call_terminate? If so, that BB would end up with multiple catch_alls in the current code. Would it be worth asserting that this doesn't happen? |
llvm/lib/Target/WebAssembly/WebAssemblyHandleEHTerminatePads.cpp | ||
---|---|---|
126 | We ensure that doesn't happen in LateEHPrepare, thanks to you. If we want to put some assert here it wouldn't be a single line assert, but we need to keep a set of something to see if there is no __clang_call_terminate calls with an EH pad that has already been added, which we are doing in LateEHPrepare anyway. I guess we don't need to duplicate that logic just for assertion..? |
llvm/lib/Target/WebAssembly/WebAssemblyHandleEHTerminatePads.cpp | ||
---|---|---|
126 | Oh, heh, I forgot about that. No need to duplicate that check here, then :) |
Is it possible for one BB to contain multiple calls to __clang_call_terminate? If so, that BB would end up with multiple catch_alls in the current code. Would it be worth asserting that this doesn't happen?