Ignore:
Timestamp:
Feb 22, 2018, 9:47:55 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
566b74f
Parents:
ad4458f
Message:

add missing files from previous commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/exception.c

    rad4458f r0304215a  
    1010// Created On       : Mon Jun 26 15:13:00 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Feb  9 14:41:55 2018
    13 // Update Count     : 8
     12// Last Modified On : Thu Feb 22 18:17:34 2018
     13// Update Count     : 11
    1414//
    1515
     
    5252    struct __cfaabi_ehm__try_resume_node * current_resume;
    5353
    54     exception * current_exception;
     54    exception_t * current_exception;
    5555    int current_handler_index;
    5656} shared_stack = {NULL, NULL, 0, 0};
     
    7171// This macro should be the only thing that needs to change across machines.  Used in the personality function, way down
    7272// in termination.
    73 // struct _Unwind_Context * -> _Unwind_Reason_Code(*)(exception *)
     73// struct _Unwind_Context * -> _Unwind_Reason_Code(*)(exception_t *)
    7474#define MATCHER_FROM_CONTEXT(ptr_to_context) \
    75         (*(_Unwind_Reason_Code(**)(exception*))(_Unwind_GetCFA(ptr_to_context) + 8))
     75        (*(_Unwind_Reason_Code(**)(exception_t *))(_Unwind_GetCFA(ptr_to_context) + 8))
    7676
    7777
    7878// RESUMPTION ================================================================
    7979
    80 void __cfaabi_ehm__throw_resume(exception * except) {
     80void __cfaabi_ehm__throw_resume(exception_t * except) {
    8181
    8282        __cfaabi_dbg_print_safe("Throwing resumption exception\n");
     
    106106
    107107void __cfaabi_ehm__try_resume_setup(struct __cfaabi_ehm__try_resume_node * node,
    108                         _Bool (*handler)(exception * except)) {
     108                        _Bool (*handler)(exception_t * except)) {
    109109        node->next = shared_stack.top_resume;
    110110        node->handler = handler;
     
    126126};
    127127
    128 #define NODE_TO_EXCEPT(node) ((exception *)(1 + (node)))
     128#define NODE_TO_EXCEPT(node) ((exception_t *)(1 + (node)))
    129129#define EXCEPT_TO_NODE(except) ((struct __cfaabi_ehm__node *)(except) - 1)
    130130
    131131// Creates a copy of the indicated exception and sets current_exception to it.
    132 static void __cfaabi_ehm__allocate_exception( exception * except ) {
     132static void __cfaabi_ehm__allocate_exception( exception_t * except ) {
    133133        struct exception_context_t * context = this_exception_context();
    134134
     
    151151
    152152// Delete the provided exception, unsetting current_exception if relivant.
    153 static void __cfaabi_ehm__delete_exception( exception * except ) {
     153static void __cfaabi_ehm__delete_exception( exception_t * except ) {
    154154        struct exception_context_t * context = this_exception_context();
    155155
     
    179179// If this isn't a rethrow (*except==0), delete the provided exception.
    180180void __cfaabi_ehm__cleanup_terminate( void * except ) {
    181         if ( *(void**)except ) __cfaabi_ehm__delete_exception( *(exception**)except );
     181        if ( *(void**)except ) __cfaabi_ehm__delete_exception( *(exception_t **)except );
    182182}
    183183
     
    233233}
    234234
    235 void __cfaabi_ehm__throw_terminate( exception * val ) {
     235void __cfaabi_ehm__throw_terminate( exception_t * val ) {
    236236        __cfaabi_dbg_print_safe("Throwing termination exception\n");
    237237
     
    348348                                        // _Unwind_Reason_Code (*matcher)() = (_Unwind_Reason_Code (*)())lsd_info.LPStart + imatcher;
    349349
    350                                         _Unwind_Reason_Code (*matcher)(exception *) =
     350                                        _Unwind_Reason_Code (*matcher)(exception_t *) =
    351351                                                MATCHER_FROM_CONTEXT(context);
    352352                                        int index = matcher(shared_stack.current_exception);
     
    409409__attribute__((noinline))
    410410void __cfaabi_ehm__try_terminate(void (*try_block)(),
    411                 void (*catch_block)(int index, exception * except),
    412                 __attribute__((unused)) int (*match_block)(exception * except)) {
     411                void (*catch_block)(int index, exception_t * except),
     412                __attribute__((unused)) int (*match_block)(exception_t * except)) {
    413413        //! volatile int xy = 0;
    414414        //! printf("%p %p %p %p\n", &try_block, &catch_block, &match_block, &xy);
Note: See TracChangeset for help on using the changeset viewer.