[LLVMdev] RFC: Exception Handling Rewrite

Jakob Stoklund Olesen stoklund at 2pi.dk
Sat Jul 23 00:50:52 PDT 2011

On Jul 23, 2011, at 12:26 AM, Jakob Stoklund Olesen wrote:

> SjLj is weird. How do we pass values along unwind edges today? Don't they need to dominate the setjmp call?

We pass them through memory:

      // If we decided we need a spill, do it.
      // FIXME: Spilling this way is overkill, as it forces all uses of
      // the value to be reloaded from the stack slot, even those that aren't
      // in the unwind blocks. We should be more selective.
      if (NeedsSpill) {
        DemoteRegToStack(*Inst, true);
So after SjLjEHPrepare, the invokes should probably be turned into calls and the unwind edges removed.

The unwind edges don't represent control flow anymore, and they are not needed for dominance. They are only used for:

  // We still want this to look like an invoke so we emit the LSDA properly,
  // so we don't transform the invoke into a call here.

It is possible we could feed all of them to a dummy landing pad that then branches to setjmp's second return?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110723/7ef5e71b/attachment.html>

More information about the llvm-dev mailing list