[LLVMdev] invoke/unwind
Garrison Venn
gvenn.cfe.dev at gmail.com
Wed Jan 13 04:08:19 PST 2010
If it helps, to see what is involved, outside of a pure IR context, see the example code, and doc at:
http://wiki.llvm.org/HowTo:_Build_JIT_based_Exception_mechanism#Source_Code:_exceptionDemo.cpp
Although this is a pure example that shows several test cases, including foreign exception interaction, it is
not an IR example, but rather a LLVM IR API example. It would be interesting to see a pure IR version of a
personality function. I don't see why this would not be possible, although costly in terms of effort. Clang
would help.
There are also ways to lower your invoke/unwind into a setjump/longjump implementation, but I do not know
how to do this in IR, as it requires function pass setup which is outside the scope of IR.
Garrison
On Jan 13, 2010, at 4:40, Dustin Laurence wrote:
> I put invoke/unwind aside because I couldn't get them to work, but I'm
> working on my evaluator now and it would be nice to figure this out so I
> don't have to unwind the stack manually. This was the reason for my
> earlier question about global declarations, and as that's cleared up I
> can easily pass exception data...if I can make unwind return out of some
> deep recursion.
>
> The behavior I get is sort of odd and took a while to
> characterize--unwind returns every time if done one level deep in the
> same translation unit. If I try it across translation units, or more
> than one call deep, I get a seg fault every time.
>
> I have reduced the problem to a trivial test case which I can post if
> there is an obvious "you idiot, everyone knows you have to frob your
> gismoids" answer.
>
> Dustin
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list