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 e9bb0e5 was             38ac6ec, checked in by Andrew Beach <ajbeach@…>, 8 years ago | 
        
          | 
Fixed some names that had drifted from terminate/resume.
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            1.5 KB | 
      
      
| Rev | Line |  | 
|---|
| [fa4805f] | 1 | // | 
|---|
|  | 2 | // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo | 
|---|
|  | 3 | // | 
|---|
|  | 4 | // The contents of this file are covered under the licence agreement in the | 
|---|
|  | 5 | // file "LICENCE" distributed with Cforall. | 
|---|
|  | 6 | // | 
|---|
|  | 7 | // exception.h -- Builtins for exception handling. | 
|---|
|  | 8 | // | 
|---|
|  | 9 | // Author           : Andrew Beach | 
|---|
|  | 10 | // Created On       : Mon Jun 26 15:11:00 2017 | 
|---|
|  | 11 | // Last Modified By : Andrew Beach | 
|---|
| [38ac6ec] | 12 | // Last Modified On : Tus Jul 11 16:31:00 2017 | 
|---|
|  | 13 | // Update Count     : 2 | 
|---|
| [fa4805f] | 14 | // | 
|---|
|  | 15 |  | 
|---|
|  | 16 | #ifndef EXCEPTION_H | 
|---|
|  | 17 | #define EXCEPTION_H | 
|---|
|  | 18 |  | 
|---|
|  | 19 |  | 
|---|
|  | 20 | // Later to be a special structure type. | 
|---|
|  | 21 | typedef int exception; | 
|---|
|  | 22 |  | 
|---|
|  | 23 | #ifdef __CFORALL__ | 
|---|
| [0fc9756b] | 24 | extern "C" { | 
|---|
| [fa4805f] | 25 | #endif | 
|---|
|  | 26 |  | 
|---|
|  | 27 | // Used in throw statement translation. | 
|---|
| [38ac6ec] | 28 | void __cfaehm__throw_terminate(exception * except) __attribute__((noreturn)); | 
|---|
|  | 29 | void __cfaehm__rethrow_terminate() __attribute__((noreturn)); | 
|---|
|  | 30 | void __cfaehm__throw_resume(exception * except); | 
|---|
| [fa4805f] | 31 |  | 
|---|
|  | 32 | // Function catches termination exceptions. | 
|---|
|  | 33 | void __cfaehm__try_terminate( | 
|---|
|  | 34 | void (*try_block)(), | 
|---|
|  | 35 | void (*catch_block)(int index, exception * except), | 
|---|
|  | 36 | int (*match_block)(exception * except)); | 
|---|
|  | 37 |  | 
|---|
|  | 38 | // Data structure creates a list of resume handlers. | 
|---|
|  | 39 | struct __cfaehm__try_resume_node { | 
|---|
| [307a732] | 40 | struct __cfaehm__try_resume_node * next; | 
|---|
| [fa4805f] | 41 | int (*handler)(exception * except); | 
|---|
|  | 42 | }; | 
|---|
|  | 43 |  | 
|---|
|  | 44 | void __cfaehm__try_resume_setup( | 
|---|
| [307a732] | 45 | struct __cfaehm__try_resume_node * node, | 
|---|
| [fa4805f] | 46 | int (*handler)(exception * except)); | 
|---|
|  | 47 | void __cfaehm__try_resume_cleanup( | 
|---|
| [307a732] | 48 | struct __cfaehm__try_resume_node * node); | 
|---|
| [fa4805f] | 49 |  | 
|---|
|  | 50 | // Check for a standard way to call fake deconstructors. | 
|---|
|  | 51 | struct __cfaehm__cleanup_hook { | 
|---|
|  | 52 | }; | 
|---|
|  | 53 |  | 
|---|
|  | 54 | #ifdef __CFORALL__ | 
|---|
|  | 55 | } | 
|---|
|  | 56 | #endif | 
|---|
|  | 57 |  | 
|---|
|  | 58 | #endif //EXCEPTION_H | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.