implementing exception handlers in a front end

Gaius Mulley gaius@glam.ac.uk
Mon Sep 8 22:16:00 GMT 2008


"Richard Guenther" <richard.guenther@gmail.com> writes:

> > to its language tree.def and gimplify this.  Before I embark on
> > this I'd like to ask whether using
> > __builtin_longjmp/__builtin_setjmp is definitely the wrong way to
> > go?
> 
> Definitely.  You will be not able to handle/throw exceptions from
> other languages if the target ABI doesn't use sjlj exceptions (which
> only a few use).

just to say thanks for the advice and that they have been implemented
in the Modula-2 front end using the cpp TRY_CATCH_EXPR/THROW etc tree
nodes.  A few core ISO Modula-2 runtime exception libraries have also
been implemented.

Anyway here are some screen-casts of inter-language C++/M2 and M2/Python
throwing and catching exceptions:

http://floppsie.comp.glam.ac.uk/download/screencasts/gnu-modula-2/python/python-exception-gnu-modula2.mp4
http://floppsie.comp.glam.ac.uk/download/screencasts/gnu-modula-2/cpp/cpp-exception-gnu-modula2.mp4

[screen-casts are roughly 7MB each]

regards,
Gaius



More information about the Gcc mailing list