[LLVMdev] RFC: Exception Handling Proposal Revised

Renato Golin rengolin at systemcall.org
Wed Dec 1 02:37:21 PST 2010


On 1 December 2010 09:46, Bill Wendling <wendling at apple.com> wrote:
> Nor these. Basically, I want the basic block that's labeled a "landing pad" to be jumped to by only a dispatch resume or unwind edge of invoke. We could do this with the c.dtor and ch.int here, but it would mean inserting useless "cleanup dispatches" that only resume to the block (see onto.catch.handlers for an example).

Hi Bill,

All cleanups come from invoke's unwinds (from foo's call) and all
catch handlers come from the main catch dispatch, so for that rule,
they all should have it. Or that's what I understood... ;)

Also, now I noticed a few things in your IR, could be just typos...
(ie. I'm not being an ass, just checking I got it right) ;)

1. Your BB flow seem odd in the try block. You call foo() four times
and then call the Ctors, rather than interpolating them as in the
source code (otherwise, all calls to foo should unwind to the catch
area, not cleanups).

2. In catch.handlers, the resume label is to %onto.catch.handlers, right?

3. In onto.catch.handlers you resume to %lpad. Which basic-block is
this? Shouldn't this be a "resume_unwinding" call of some sort (if Q2
is right)?

4. Your catch handlers return void, shouldn't then branch to %return
instead? In this case, a front-end would probably call that label a
"%finally" and that would branch to %return, or return directly.


Which brings me to my final question: In languages where the finally
HAS to run, like Java, would that be a simple cleanup regions or do we
need something special from catch's dispatch's resume AND %finally
block?

cheers,
--renato




More information about the llvm-dev mailing list