[LLVMdev] nonlocal go to -- how?

Jonathan S. Shapiro shap at eros-os.com
Mon May 5 04:28:00 PDT 2008


On Mon, 2008-05-05 at 09:56 +0200, Duncan Sands wrote:
> you can roll your unwinder using multiple return values (support for functions
> that return multiple values was recently added)...

Yes. In fact, this generalizes to exception handlers in general, which
demonstrates that exceptions are "pure" in the functional language
sense.

Slight modification to what Duncan wrote. What you conceptually want
here is to convert the return type into a discriminated union. One leg
is used for normal return, while the other is used for goto exit and
target label ID (I'm assuming that goto exit does not carry a return
value). But it's the same idea as the one Duncan was sketching.


shap




More information about the llvm-dev mailing list