Changeset 0100882 for libcfa/src


Ignore:
Timestamp:
Apr 9, 2020, 6:42:22 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
7df014f
Parents:
2ad74d8 (diff), cb20dcd (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

Location:
libcfa/src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/Makefile.am

    r2ad74d8 r0100882  
    4848thread_headers_nosrc = concurrency/invoke.h
    4949thread_headers = concurrency/coroutine.hfa concurrency/thread.hfa concurrency/kernel.hfa concurrency/monitor.hfa concurrency/mutex.hfa
    50 thread_libsrc = concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa concurrency/invoke.c concurrency/preemption.cfa ${thread_headers:.hfa=.cfa}
     50thread_libsrc = concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa concurrency/invoke.c concurrency/io.cfa concurrency/preemption.cfa ${thread_headers:.hfa=.cfa}
    5151else
    5252headers =
  • libcfa/src/Makefile.in

    r2ad74d8 r0100882  
    164164am__libcfathread_la_SOURCES_DIST =  \
    165165        concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa \
    166         concurrency/invoke.c concurrency/preemption.cfa \
    167         concurrency/coroutine.cfa concurrency/thread.cfa \
    168         concurrency/kernel.cfa concurrency/monitor.cfa \
    169         concurrency/mutex.cfa
     166        concurrency/invoke.c concurrency/io.cfa \
     167        concurrency/preemption.cfa concurrency/coroutine.cfa \
     168        concurrency/thread.cfa concurrency/kernel.cfa \
     169        concurrency/monitor.cfa concurrency/mutex.cfa
    170170@BUILDLIB_TRUE@am__objects_3 = concurrency/coroutine.lo \
    171171@BUILDLIB_TRUE@ concurrency/thread.lo concurrency/kernel.lo \
     
    174174@BUILDLIB_TRUE@ concurrency/CtxSwitch-@ARCHITECTURE@.lo \
    175175@BUILDLIB_TRUE@ concurrency/alarm.lo concurrency/invoke.lo \
    176 @BUILDLIB_TRUE@ concurrency/preemption.lo $(am__objects_3)
     176@BUILDLIB_TRUE@ concurrency/io.lo concurrency/preemption.lo \
     177@BUILDLIB_TRUE@ $(am__objects_3)
    177178am_libcfathread_la_OBJECTS = $(am__objects_4)
    178179libcfathread_la_OBJECTS = $(am_libcfathread_la_OBJECTS)
     
    474475@BUILDLIB_FALSE@thread_headers =
    475476@BUILDLIB_TRUE@thread_headers = concurrency/coroutine.hfa concurrency/thread.hfa concurrency/kernel.hfa concurrency/monitor.hfa concurrency/mutex.hfa
    476 @BUILDLIB_TRUE@thread_libsrc = concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa concurrency/invoke.c concurrency/preemption.cfa ${thread_headers:.hfa=.cfa}
     477@BUILDLIB_TRUE@thread_libsrc = concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa concurrency/invoke.c concurrency/io.cfa concurrency/preemption.cfa ${thread_headers:.hfa=.cfa}
    477478
    478479#----------------------------------------------------------------------------------------------------------------
     
    608609        concurrency/$(DEPDIR)/$(am__dirstamp)
    609610concurrency/invoke.lo: concurrency/$(am__dirstamp) \
     611        concurrency/$(DEPDIR)/$(am__dirstamp)
     612concurrency/io.lo: concurrency/$(am__dirstamp) \
    610613        concurrency/$(DEPDIR)/$(am__dirstamp)
    611614concurrency/preemption.lo: concurrency/$(am__dirstamp) \
  • libcfa/src/exception.c

    r2ad74d8 r0100882  
    1010// Created On       : Mon Jun 26 15:13:00 2017
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Apr 06 14:40:00 2020
    13 // Update Count     : 15
     12// Last Modified On : Thr Apr  9 12:20:00 2020
     13// Update Count     : 17
    1414//
    1515
     
    2828#include <unwind.h>
    2929#include <bits/debug.hfa>
     30#include "stdhdr/assert.h"
    3031
    3132// FIX ME: temporary hack to keep ARM build working
     
    216217                struct _Unwind_Context * unwind_context,
    217218                void * stop_param) {
    218         if ( actions & _UA_END_OF_STACK  ) exit(1);
    219         if ( actions & _UA_CLEANUP_PHASE ) return _URC_NO_REASON;
    220 
    221         return _URC_FATAL_PHASE2_ERROR;
     219        // Verify actions follow the rules we expect.
     220        verify((actions & _UA_CLEANUP_PHASE) && actions & (_UA_FORCE_UNWIND));
     221        verify(!(actions & (_UA_SEARCH_PHASE | _UA_HANDER_FRAME)));
     222
     223        if ( actions & _UA_END_OF_STACK ) {
     224                exit(1);
     225        } else {
     226                return _URC_NO_REASON;
     227        }
    222228}
    223229
     
    282288                        version, actions, exception_class, unwind_exception, unwind_context);
    283289
    284         // If we've reached the end of the stack then there is nothing much we can do...
    285         if (actions & _UA_END_OF_STACK) return _URC_END_OF_STACK;
    286 
     290        // Verify that actions follow the rules we expect.
     291        // This function should never be called at the end of the stack.
     292        verify(!(actions & _UA_END_OF_STACK));
     293        // Either only the search phase flag is set or...
    287294        if (actions & _UA_SEARCH_PHASE) {
     295                verify(actions == _UA_SEARCH_PHASE);
    288296                __cfaabi_dbg_print_safe(" lookup phase");
    289         }
    290         else if (actions & _UA_CLEANUP_PHASE) {
     297        // ... we are in clean-up phase.
     298        } else {
     299                verify(actions & _UA_CLEANUP_PHASE);
    291300                __cfaabi_dbg_print_safe(" cleanup phase");
    292         }
    293         // Just in case, probably can't actually happen
    294         else {
    295                 printf(" error\n");
    296                 return _URC_FATAL_PHASE1_ERROR;
     301                // We shouldn't be the handler frame during forced unwind.
     302                if (actions & _UA_HANDLER_FRAME) {
     303                        verify(!(actions & _UA_FORCE_UNWIND));
     304                        __cfaabi_dbg_print_safe(" (handler frame)");
     305                } else if (actions & _UA_FORCE_UNWIND) {
     306                        __cfaabi_dbg_print_safe(" (force unwind)");
     307                }
    297308        }
    298309
     
    396407                        // This is only a cleanup handler, ignore it
    397408                        __cfaabi_dbg_print_safe(" no action");
    398                 } else if (actions & _UA_CLEANUP_PHASE) {
     409                } else {
    399410                        // In clean-up phase, no destructors here but this could be the handler.
    400411
     
    434445
    435446#pragma GCC push_options
    436 #pragma GCC optimize("O0")
     447#pragma GCC optimize("no-toplevel-reorder")
    437448
    438449// Try statements are hoisted out see comments for details. While this could probably be unique
Note: See TracChangeset for help on using the changeset viewer.