This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
implementing exception handlers in a front end
- From: Gaius Mulley <gaius at glam dot ac dot uk>
- To: gcc at gcc dot gnu dot org
- Date: 09 Jul 2008 14:32:50 +0100
- Subject: implementing exception handlers in a front end
Hi,
I'm currently trying to implement the exception handling in GNU
Modula-2 and was wondering which of the following two routes to use.
I was initially enthusiastic about using __builtin_setjmp/
__builtin_longjmp as Modula-2 exceptions can be implemented with these
mechanisms - and it would also be tantalisingly easy to code..
However, upon searching this list I see that there are a number of
problems with __builtin_setjmp and __builtin_longjmp and have begun
to examine TRY_CATCH_EXPR nodes instead. It seems that if this later
route is taken then the front end also needs to add:
DEFTREECODE (THROW_EXPR, "throw", tcc_unary, 1)
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?
regards,
Gaius