Hi Chris!
Chris Lattner wrote:
[snip]
> This is generally done with global variables. The C++ front-end
> basically generates code like this:
>> C++: throw 42;
>> Pseudo LLVM code:
> int *E = allocate_exception_memory(4);
> *E = 42;
> add_to_current_exception_stack(E);
> unwind
>> I imagine that something similar should work for pypy.
This is indeed pretty much what I did in genllvm1 (note that we're
already writing our second LLVM backend :-). It's even a bit easier
since we don't need an exception stack but only one single exception.
One problem is that exception matching is not entirely straightforward
although this is a property of the PyPy model and has nothing to do with
LLVM per se.
Regards,
Carl Friedrich