[LLVMdev] Exception Handling Problems

Renato Golin rengolin at systemcall.org
Wed Apr 13 01:50:31 PDT 2011


On 12 April 2011 23:04, Bill Wendling <wendling at apple.com> wrote:
> * Exception handling needs to be a first-class citizen of the LLVM IR in order
>  for it to be understood and modified correctly by all passes.

Agreed!


> * The information needed to generating correct EH tables needs to be available
>  at more than just one point in the function.

Indeed, it needs to be consistent and reachable from multiple places,
code and unwind blocks.

The unwind call graph must be first-class citizen and it must be
tightly coupled with the normal flow (to allow inlining) and the
semantics must be clear, so passes won't destroy it easily.

However, since the C++ ABI is but one example on how to do EH and LLVM
is language agnostic, I'm inclined to say that this is an impossible
task.

This is not to say that it can't be done, far from it, but that it
won't be as clean as we'd hope for. There are some things (like
exception handling and bitfields) that doesn't matter how hard you try
refactoring, it always end up dirty.

What we need is a clear set of premises (just like John has just made)
that are language agnostic and follow them wholeheartedly. We should
only try to come up with a plan for IR when those premises have been
agreed in a document in SVN.

cheers,
--renato




More information about the llvm-dev mailing list