Changeset 979df46


Ignore:
Timestamp:
May 13, 2020, 3:46:00 PM (5 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
2223c80, 69f15c7
Parents:
8d462e5
Message:

Initial cancellation interface, required for default operation.

Location:
libcfa/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/exception.c

    r8d462e5 r979df46  
    223223
    224224// Cancel the current stack, prefroming approprate clean-up and messaging.
    225 static __attribute__((noreturn)) void __cfaehm_cancel_stack(
    226                 exception_t * exception ) {
     225void __cfaehm_cancel_stack( exception_t * exception ) {
    227226        // TODO: Detect current stack and pick a particular stop-function.
    228227        _Unwind_Reason_Code ret;
  • libcfa/src/exception.h

    r8d462e5 r979df46  
    3838
    3939
     40void __cfaehm_cancel_stack(exception_t * except) __attribute__((noreturn));
     41
    4042// Used in throw statement translation.
    4143void __cfaehm_throw_terminate(exception_t * except) __attribute__((noreturn));
  • libcfa/src/exception.hfa

    r8d462e5 r979df46  
    1010// Created On       : Thu Apr  7 10:25:00 2020
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Thu Apr  7 10:25:00 2020
    13 // Update Count     : 0
     12// Last Modified On : Wed Apr 13 15:42:00 2020
     13// Update Count     : 1
    1414//
     15
     16// WARNING: This is for documentation as it will match ANY type.
     17trait is_exception(dtype T) {
     18        /* The first field must be a pointer to a virtual table.
     19         * That virtual table must be a decendent of the base exception virtual table.
     20         */
     21};
     22
     23forall(dtype T | is_exception(T))
     24inline void cancel_stack(T & except) __attribute__((noreturn)) {
     25        __cfaehm_cancel_stack( (exception_t *)&except );
     26}
    1527
    1628// Everything below this line should be considered a patch while the exception
Note: See TracChangeset for help on using the changeset viewer.