diff options
| author | Ash Wolf <ninji@wuffs.org> | 2022-11-20 00:07:22 -0500 | 
|---|---|---|
| committer | Ash Wolf <ninji@wuffs.org> | 2022-11-20 00:07:22 -0500 | 
| commit | 9d2728a5605f651934fe67a6fe6986b3e4a2c011 (patch) | |
| tree | e81e0a3588a0c8d1855bf28316efe27d86b04d66 /includes/compiler/Exceptions.h | |
| parent | 9a46dd0e2e80790d9848c0bbd718932a27c23269 (diff) | |
| download | MWCC-9d2728a5605f651934fe67a6fe6986b3e4a2c011.tar.gz MWCC-9d2728a5605f651934fe67a6fe6986b3e4a2c011.zip | |
add a bunch of code and a ton of stub files for later
Diffstat (limited to '')
| -rw-r--r-- | includes/compiler/Exceptions.h | 122 | 
1 files changed, 122 insertions, 0 deletions
| diff --git a/includes/compiler/Exceptions.h b/includes/compiler/Exceptions.h new file mode 100644 index 0000000..f1096c8 --- /dev/null +++ b/includes/compiler/Exceptions.h @@ -0,0 +1,122 @@ +#ifndef COMPILER_EXCEPTIONS_H +#define COMPILER_EXCEPTIONS_H + +#include "compiler/common.h" + +#ifdef __MWERKS__ +#pragma options align=mac68k +#endif + +typedef enum ExceptionActionType { +    EAT_NOP, +    EAT_DESTROYLOCAL, +    EAT_DESTROYLOCALCOND, +    EAT_DESTROYLOCALOFFSET, +    EAT_DESTROYLOCALPOINTER, +    EAT_DESTROYLOCALARRAY, +    EAT_DESTROYPARTIALARRAY, +    EAT_DESTROYMEMBER, +    EAT_DESTROYMEMBERCOND, +    EAT_DESTROYMEMBERARRAY, +    EAT_DELETEPOINTER, +    EAT_DELETELOCALPOINTER, +    EAT_DELETEPOINTERCOND, +    EAT_CATCHBLOCK, +    EAT_ACTIVECATCHBLOCK, +    EAT_SPECIFICATION, +    EAT_TERMINATE, +    EAT_DESTROYBASE, +    EAT_NACTIONS +} ExceptionActionType; + +struct ExceptionAction { +    ExceptionAction *prev; +    union { +        struct { +            Object *local; +            Object *dtor; +        } destroy_local; +        struct { +            Object *local; +            Object *cond; +            Object *dtor; +        } destroy_local_cond; +        struct { +            Object *local; +            Object *dtor; +            SInt32 offset; +        } destroy_local_offset; +        struct { +            Object *pointer; +            Object *dtor; +        } destroy_local_pointer; +        struct { +            Object *localarray; +            Object *dtor; +            SInt32 elements; +            SInt32 element_size; +        } destroy_local_array; +        struct { +            Object *arraypointer; +            Object *arraycounter; +            Object *dtor; +            Object *element_size; +        } destroy_partial_array; +        struct { +            Object *objectptr; +            Object *dtor; +            SInt32 offset; +        } destroy_member; +        struct { +            Object *objectptr; +            Object *cond; +            Object *dtor; +            SInt32 offset; +        } destroy_member_cond; +        struct { +            Object *objectptr; +            Object *dtor; +            SInt32 offset; +            SInt32 elements; +            SInt32 element_size; +        } destroy_member_array; +        struct { +            Object *pointerobject; +            Object *deletefunc; +        } delete_pointer; +        struct { +            Object *pointerobject; +            Object *deletefunc; +            Object *cond; +        } delete_pointer_cond; +        struct { +            Object *catch_object; +            Object *catch_info_object; +            CLabel *catch_label; +            Object *catch_typeid; +            Type *catch_type; +            UInt32 catch_qual; +        } catch_block; +        struct { +            Object *catch_info_object; +            Boolean call_dtor; +        } active_catch_block; +        struct { +            SInt32 unexp_ids; +            Object **unexp_id; +            CLabel *unexp_label; +            Object *unexp_info_object; +        } specification; +        struct { +            Object *object; +            Boolean is_dep; +        } local; +    } data; +    ExceptionActionType type; +}; + +#ifdef __MWERKS__ +#pragma options align=reset +#endif + +#endif | 
