ADT
aaron-thesis
arm-eh
ast-experimental
cleanup-dtors
deferred_resn
demangler
enum
forall-pointer-decay
jacob/cs343-translation
jenkins-sandbox
new-ast
new-ast-unique-expr
new-env
no_list
persistent-indexer
pthread-emulation
qualifiedEnum
resolv-new
with_gc
Last change
on this file since 20877d2 was 35ba584c, checked in by Andrew Beach <ajbeach@…>, 8 years ago |
Added rethrow to translation.
Implemend and tested termination rethrowing.
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[35dd0f42] | 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.
|
---|
| 4 | typedef int exception;
|
---|
| 5 |
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | // These might be given simpler names and made public.
|
---|
| 9 | void __throw_terminate(exception except) __attribute__((noreturn));
|
---|
[35ba584c] | 10 | void __rethrow_terminate(void) __attribute__((noreturn));
|
---|
[35dd0f42] | 11 | void __throw_resume(exception except);
|
---|
| 12 |
|
---|
| 13 | void __try_terminate(void (*try_block)(),
|
---|
| 14 | void (*catch_block)(int index, exception except),
|
---|
| 15 | int (*match_block)(exception except));
|
---|
| 16 |
|
---|
| 17 | struct __try_resume_node {
|
---|
| 18 | struct __try_resume_node * next;
|
---|
| 19 | _Bool (*try_to_handle)(exception except);
|
---|
| 20 | };
|
---|
| 21 |
|
---|
| 22 | struct __cleanup_hook {};
|
---|
| 23 |
|
---|
| 24 |
|
---|
[35ba584c] | 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 | */
|
---|
[35dd0f42] | 30 | struct 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 |
|
---|
[e4e9173] | 39 | extern struct shared_stack_t shared_stack;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.