[LLVMdev] RFC: Replace __cxa_begin_catch/__cxa_end_catch with intrinsics

John McCall
2015-02-03T01:17:40Z

> On Feb 2, 2015, at 4:53 PM, Reid Kleckner <rnk at google.com> wrote:
> This seems reasonable to me. Adding John explicitly…

Thanks, Reid.

Andy, I understand why Windows EH needs custom lowering here, and using
intrinsics seems like a fine approach, but I don’t understand why you’re
proposing changing the Itanium code generation pattern.  There’s no reason for
backends to have special knowledge of __cxa_begin_catch, and it’s actually not a
good idea for them to do so, because that’s unnecessarily language-specific and
personality-specific; even today, Objective-C EH implementations do use separate
personality and different begin/end catch functions.

If we ever decide to support a libUnwind personality function that relies on
function outlining — and I do have that as an eventual goal — it’ll probably
want a slightly different code-generation pattern anyway.  So write your code
generally where you can, but don’t worry about creating some sort of ultimate
unified backend EH lowering.

John.