Ignore:
Timestamp:
Oct 8, 2020, 12:45:43 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
8fc9a5f, baee756
Parents:
391c065 (diff), 6fbe9a5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/exception.h

    r391c065 r8e4bc30  
    7676// implemented in the .c file either so they all have to be inline.
    7777
    78 trait is_exception(dtype exceptT) {
     78trait is_exception(dtype exceptT, dtype virtualT) {
    7979        /* The first field must be a pointer to a virtual table.
    80          * That virtual table must be a decendent of the base exception virtual tab$
     80         * That virtual table must be a decendent of the base exception virtual table.
    8181         */
    82         void mark_exception(exceptT *);
    83         // This is never used and should be a no-op.
     82        virtualT const & get_exception_vtable(exceptT *);
     83        // Always returns the virtual table for this type (associated types hack).
    8484};
    8585
    86 trait is_termination_exception(dtype exceptT | is_exception(exceptT)) {
     86trait is_termination_exception(dtype exceptT, dtype virtualT | is_exception(exceptT, virtualT)) {
    8787        void defaultTerminationHandler(exceptT &);
    8888};
    8989
    90 trait is_resumption_exception(dtype exceptT | is_exception(exceptT)) {
     90trait is_resumption_exception(dtype exceptT, dtype virtualT | is_exception(exceptT, virtualT)) {
    9191        void defaultResumptionHandler(exceptT &);
    9292};
    9393
    94 forall(dtype exceptT | is_termination_exception(exceptT))
     94forall(dtype exceptT, dtype virtualT | is_termination_exception(exceptT, virtualT))
    9595static inline void $throw(exceptT & except) {
    9696        __cfaehm_throw_terminate(
     
    100100}
    101101
    102 forall(dtype exceptT | is_resumption_exception(exceptT))
     102forall(dtype exceptT, dtype virtualT | is_resumption_exception(exceptT, virtualT))
    103103static inline void $throwResume(exceptT & except) {
    104104        __cfaehm_throw_resume(
     
    108108}
    109109
    110 forall(dtype exceptT | is_exception(exceptT))
     110forall(dtype exceptT, dtype virtualT | is_exception(exceptT, virtualT))
    111111static inline void cancel_stack(exceptT & except) __attribute__((noreturn)) {
    112112        __cfaehm_cancel_stack( (exception_t *)&except );
    113113}
    114114
    115 forall(dtype exceptT | is_exception(exceptT))
     115forall(dtype exceptT, dtype virtualT | is_exception(exceptT, virtualT))
    116116static inline void defaultTerminationHandler(exceptT & except) {
    117117        return cancel_stack( except );
    118118}
    119119
    120 forall(dtype exceptT | is_exception(exceptT))
     120forall(dtype exceptT, dtype virtualT | is_exception(exceptT, virtualT))
    121121static inline void defaultResumptionHandler(exceptT & except) {
    122122        throw except;
Note: See TracChangeset for help on using the changeset viewer.