| 
            Last change
 on this file since b08ab18 was             c529a24, checked in by Andrew Beach <ajbeach@…>, 8 years ago           | 
        
        
          | 
             
Updates to exception handling and translation. 
 
           | 
        
        
          
            
              - 
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 | void __throw_terminate(exception except) __attribute__((noreturn));
 | 
|---|
| [35ba584c] | 9 | void __rethrow_terminate(void) __attribute__((noreturn));
 | 
|---|
| [35dd0f42] | 10 | void __throw_resume(exception except);
 | 
|---|
 | 11 | 
 | 
|---|
 | 12 | void __try_terminate(void (*try_block)(),
 | 
|---|
 | 13 |         void (*catch_block)(int index, exception except),
 | 
|---|
 | 14 |         int (*match_block)(exception except));
 | 
|---|
 | 15 | 
 | 
|---|
 | 16 | struct __try_resume_node {
 | 
|---|
 | 17 |         struct __try_resume_node * next;
 | 
|---|
 | 18 |         _Bool (*try_to_handle)(exception except);
 | 
|---|
 | 19 | };
 | 
|---|
 | 20 | 
 | 
|---|
| [c529a24] | 21 | void __try_resume_cleanup(struct __try_resume_node * node);
 | 
|---|
 | 22 | 
 | 
|---|
| [35dd0f42] | 23 | struct __cleanup_hook {};
 | 
|---|
 | 24 | 
 | 
|---|
 | 25 | 
 | 
|---|
| [35ba584c] | 26 | 
 | 
|---|
 | 27 | /* The following code is temperary. How exceptions interact with coroutines
 | 
|---|
 | 28 |  * and threads means that... well I'm going to get it working ignoring those
 | 
|---|
 | 29 |  * first, then get it working with concurrency.
 | 
|---|
| [c529a24] | 30 |  * Eventually there should be some global name that just gets you the right
 | 
|---|
 | 31 |  * data block.
 | 
|---|
| [35ba584c] | 32 |  */
 | 
|---|
| [35dd0f42] | 33 | struct shared_stack_t {
 | 
|---|
 | 34 |         struct __try_resume_node * top_resume;
 | 
|---|
 | 35 |         struct __try_resume_node * current_resume;
 | 
|---|
 | 36 | 
 | 
|---|
 | 37 |         exception current_exception;
 | 
|---|
 | 38 |         int current_handler_index;
 | 
|---|
 | 39 | };
 | 
|---|
 | 40 | 
 | 
|---|
| [e4e9173] | 41 | extern struct shared_stack_t shared_stack;
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.