[LLVMdev] RFC: Exception Handling Rewrite

Renato Golin rengolin at systemcall.org
Tue Aug 2 07:22:04 PDT 2011


Hi Duncan,


On 31 July 2011 19:06, Duncan Sands <baldrick at free.fr> wrote:
> Something like this could be nice for LLVM too.  For example the LLVM garbage
> collector codegen code wants to insert a simple cleanup: run some cleanup code
> then resume.  It would be nice if it didn't have to specify a personality.  For
> example by using the null pointer for the personality function.  That said I
> suppose such code could be required to specify (eg) the C personality function.

I think this is too much for this first proposal. Using the C
personality function as a default is easy to implement and easy to
refactor later.


> Perhaps the same goes for catches
> and so on: is a global really needed and not its name?

I can't see why we'd need the global. Maybe for IR validation (if you
get the name wrong) but that's all.


> Finally, rather than baking cleanups, filters etc into the IR, I suppose the
> landingpad instruction could just be:
>
>   %res = landingpad<some type> data<ty>
>
> For standard setups "data" could be a struct type, with fields for the
> personality function, a cleanup flag, lists of catches and filters and so on.

I still prefer the explicit fields in an explicit instruction.

cheers,
--renato




More information about the llvm-dev mailing list