Changeset 1c01c58 for libcfa/src/exception.h
- Timestamp:
- Sep 9, 2020, 5:03:40 PM (3 years ago)
- Branches:
- arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b9fa85b, c402739
- Parents:
- 2b7f6f0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/exception.h
r2b7f6f0 r1c01c58 76 76 // implemented in the .c file either so they all have to be inline. 77 77 78 trait is_exception(dtype T) {78 trait is_exception(dtype exceptT) { 79 79 /* The first field must be a pointer to a virtual table. 80 80 * That virtual table must be a decendent of the base exception virtual tab$ 81 81 */ 82 void mark_exception( T *);82 void mark_exception(exceptT *); 83 83 // This is never used and should be a no-op. 84 84 }; 85 85 86 trait is_termination_exception(dtype T | is_exception(T)) {87 void defaultTerminationHandler( T &);86 trait is_termination_exception(dtype exceptT | is_exception(exceptT)) { 87 void defaultTerminationHandler(exceptT &); 88 88 }; 89 89 90 trait is_resumption_exception(dtype T | is_exception(T)) {91 void defaultResumptionHandler( T &);90 trait is_resumption_exception(dtype exceptT | is_exception(exceptT)) { 91 void defaultResumptionHandler(exceptT &); 92 92 }; 93 93 94 forall(dtype T | is_termination_exception(T))95 static inline void $throw( T & except) {94 forall(dtype exceptT | is_termination_exception(exceptT)) 95 static inline void $throw(exceptT & except) { 96 96 __cfaehm_throw_terminate( 97 97 (exception_t *)&except, … … 100 100 } 101 101 102 forall(dtype T | is_resumption_exception(T))103 static inline void $throwResume( T & except) {102 forall(dtype exceptT | is_resumption_exception(exceptT)) 103 static inline void $throwResume(exceptT & except) { 104 104 __cfaehm_throw_resume( 105 105 (exception_t *)&except, … … 108 108 } 109 109 110 forall(dtype T | is_exception(T))111 static inline void cancel_stack( T & except) __attribute__((noreturn)) {110 forall(dtype exceptT | is_exception(exceptT)) 111 static inline void cancel_stack(exceptT & except) __attribute__((noreturn)) { 112 112 __cfaehm_cancel_stack( (exception_t *)&except ); 113 113 } 114 114 115 forall(dtype T | is_exception(T))116 static inline void defaultTerminationHandler( T & except) {115 forall(dtype exceptT | is_exception(exceptT)) 116 static inline void defaultTerminationHandler(exceptT & except) { 117 117 return cancel_stack( except ); 118 118 } 119 119 120 forall(dtype T | is_exception(T))121 static inline void defaultResumptionHandler( T & except) {120 forall(dtype exceptT | is_exception(exceptT)) 121 static inline void defaultResumptionHandler(exceptT & except) { 122 122 throw except; 123 123 }
Note: See TracChangeset
for help on using the changeset viewer.