[llvm-commits] [Patch] DwarfEHPrepare for New EH

Bill Wendling wendling at apple.com
Mon Aug 8 15:08:48 PDT 2011


On Aug 8, 2011, at 8:15 AM, Duncan Sands wrote:

> Hi Bill,
> 
>> This patch implements the small amount which needs to be done by the DwarfEHPrepare pass. What it does is takes the 'resume' instruction and converts it into a call to _Unwind_Resume. The SjLj changes will be done in the SjLj lowering pass.
> 
> why do this in DwarfEHPrepare (which should be zapped in the long run I guess)?

I did it here because inserting a function call in the back-end is tricky. :) But yes, I'd love to see DwarfEHPrepare (and SjLjEHPrepare) go away.

> Shouldn't it be lowered in SelectionDAGBuilder like other instructions are?
> Also, it should probably be turned into a RESUME SDag Node, so that different
> targets can be different things with it (eg: ARM doesn't want _Unwind_Resume
> IIRC).
> 
The ARM stuff uses SjLj exception handling, which is handled by the SjLjEHPrepare pass.

The question isn't so much "which back-end needs what function call?", but "what is the family of exception handling we're dealing with, and what does its ABI tell us should be the 'resume' call?". We currently support two types of exception handling, of course: zero-cost and setjmp-longjmp. We are told which one to use via a flag in MCAsmInfo, though it's really personality function specific. I don't know if this will (or should) change in the future.

-bw




More information about the llvm-commits mailing list