source: doc/working/exception/impl/exception.h @ 35ba584c

aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerresolv-newwith_gc
Last change on this file since 35ba584c was 35ba584c, checked in by Andrew Beach <ajbeach@…>, 5 years ago

Added rethrow to translation.
Implemend and tested termination rethrowing.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1// Trying to create the new secret header for the exception handling mechanism.
2
3// This will have to go in the public header later.
4typedef int exception;
5
6
7
8// These might be given simpler names and made public.
9void __throw_terminate(exception except) __attribute__((noreturn));
10void __rethrow_terminate(void) __attribute__((noreturn));
11void __throw_resume(exception except);
12
13void __try_terminate(void (*try_block)(),
14        void (*catch_block)(int index, exception except),
15        int (*match_block)(exception except));
16
17struct __try_resume_node {
18        struct __try_resume_node * next;
19        _Bool (*try_to_handle)(exception except);
20};
21
22struct __cleanup_hook {};
23
24
25
26/* The following code is temperary. How exceptions interact with coroutines
27 * and threads means that... well I'm going to get it working ignoring those
28 * first, then get it working with concurrency.
29 */
30struct shared_stack_t {
31        //struct lock lock;
32        struct __try_resume_node * top_resume;
33        struct __try_resume_node * current_resume;
34
35        exception current_exception;
36        int current_handler_index;
37};
38
39extern struct shared_stack_t shared_stack;
Note: See TracBrowser for help on using the repository browser.