Ignore:
Timestamp:
Aug 9, 2017, 2:08:14 PM (4 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
65cdc1e
Parents:
e195093
Message:

Structure based exception handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/exception.h

    re195093 rcbce272  
    1010// Created On       : Mon Jun 26 15:11:00 2017
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 27 12:42:00 2017
    13 // Update Count     : 4
     12// Last Modified On : Fri Aug  4 15:20:00 2017
     13// Update Count     : 5
    1414//
    1515
     
    2121#endif
    2222
    23 #if 1
    24 typedef int exception;
    25 #else
    26 struct exception_t;
    27 struct exception_t_vtable {
    28         struct exception_t_vtable const * parent;
     23struct __cfaehm__base_exception_t;
     24typedef struct __cfaehm__base_exception_t exception;
     25struct __cfaehm__base_exception_t_vtable {
     26        const struct __cfaehm__base_exception_t_vtable * parent;
    2927        size_t size;
    30         void (*copy)(struct exception_t *this, struct exception_t * other);
    31         void (*free)(struct exception_t *this);
    32         const char (*msg)(struct exception_t *this);
     28        void (*copy)(struct __cfaehm__base_exception_t *this,
     29                     struct __cfaehm__base_exception_t * other);
     30        void (*free)(struct __cfaehm__base_exception_t *this);
     31        const char (*msg)(struct __cfaehm__base_exception_t *this);
    3332};
    34 struct exception_t {
    35         struct exception_vtable const * virtual_table;
     33struct __cfaehm__base_exception_t {
     34        struct __cfaehm__base_exception_t_vtable const * virtual_table;
    3635};
    37 typedef struct exception_t exception;
    38 #endif
     36extern struct __cfaehm__base_exception_t_vtable
     37        ___cfaehm__base_exception_t_vtable_instance;
    3938
    4039
     
    5150
    5251// Clean-up the exception in catch blocks.
    53 void __cfaehm__cleanup_terminate(exception ** except);
     52void __cfaehm__cleanup_terminate(void * except);
    5453
    5554// Data structure creates a list of resume handlers.
Note: See TracChangeset for help on using the changeset viewer.