Closed
Description
If you compile a program with -Z no-landing-pads
plus -C lto
it is intended that all landing pads are removed. This does not happen on MSVC, however! A simple fn main() {}
compiled with LTO will still have a bunch of invoke
instructions lying around, even though they only call nounwind
functions.
I believe this is due to this check. Our personality functions, __C_specific_handler
and _except_handler3
, can receive control flow from normal faults, so LLVM won't optimize away the invoke
instructions.
Seems like we should use __CxxFrameHandler3
(the C++ personality function) if we can (or emulate it).