WinEHPrepare marks any function call from EH funclets as unreachable, if it's not a nounwind intrinsic and has no proper funclet bundle operand. This affects ARC intrinsics on Windows, because they are lowered to regular function calls in the PreISelIntrinsicLowering pass. It caused silent binary truncations and crashes during unwinding with the GNUstep ObjC runtime: https://github.com/gnustep/libobjc2/issues/222
This patch adds a new function llvm::IntrinsicInst::mayLowerToFunctionCall() that aims to collect all affected intrinsic IDs.
- Clang CodeGen uses it to determine whether or not it must emit a funclet bundle operand.
- PreISelIntrinsicLowering asserts that the function returns true for all ObjC runtime calls it lowers.
- LLVM uses it to determine whether or not a funclet bundle operand must be propagated to inlined call sites.
Minor nit, should be /// for a doc comment.