This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: implementing exception handlers in a front end
- From: Gaius Mulley <gaius at glam dot ac dot uk>
- To: richard dot guenther at gmail dot com
- Cc: gcc at gcc dot gnu dot org
- Date: 08 Sep 2008 23:10:40 +0100
- Subject: Re: implementing exception handlers in a front end
"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