Changeset cd02108 for libcfa/src


Ignore:
Timestamp:
Aug 12, 2020, 1:39:41 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
419c434
Parents:
5bcdc8c (diff), dab09ad (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:
4 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/invoke.c

    r5bcdc8c rcd02108  
    146146
    147147#elif defined( __ARM_ARCH )
    148 #error ARM needs to be upgrade to use to parameters like X86/X64 (A.K.A. : I broke this and do not know how to fix it)
     148#error ARM needs to be upgrade to use two parameters like X86/X64 (A.K.A. : I broke this and do not know how to fix it)
     149        // More details about the error:
     150        // To avoid the thunk problem, I changed the invoke routine to pass the main explicitly
     151        // instead of relying on an assertion. This effectively hoists any required thunk one level
     152        // which was enough to get to global scope in most cases.
     153        // This means that __cfactx_invoke_... now takes two parameters and the FakeStack needs
     154        // to be adjusted as a consequence of that.
     155        // I don't know how to do that for ARM, hence the #error
     156
    149157        struct FakeStack {
    150158                float fpRegs[16];                       // floating point registers
  • libcfa/src/concurrency/kernel.cfa

    r5bcdc8c rcd02108  
    532532                unsigned total   = this.total;
    533533                processor * proc = &this.list`first;
     534                // Thread fence is unnecessary, but gcc-8 and older incorrectly reorder code without it
     535                __atomic_thread_fence(__ATOMIC_SEQ_CST);
    534536                if(l != __atomic_load_n(&this.lock, __ATOMIC_SEQ_CST)) { Pause(); continue; }
    535537                return [idle, total, proc];
  • libcfa/src/parseargs.cfa

    r5bcdc8c rcd02108  
    2525#include "limits.hfa"
    2626
     27extern int cfa_args_argc;
     28extern char ** cfa_args_argv;
     29extern char ** cfa_args_envp;
     30
    2731void printopt(FILE * out, int width, int max, char sn, const char * ln, const char * help) {
    2832        int hwidth = max - (11 + width);
     
    3539                fprintf(out, "%*s%.*s\n", width + 11, "", hwidth, help);
    3640        }
     41}
     42
     43void parse_args( cfa_option options[], size_t opt_count, const char * usage, char ** & left ) {
     44        parse_args(cfa_args_argc, cfa_args_argv, options, opt_count, usage, left );
    3745}
    3846
     
    182190}
    183191
    184 bool parse(const char * arg, size_t & value) {
     192bool parse(const char * arg, unsigned long & value) {
    185193        char * end;
    186194        unsigned long long int r = strtoull(arg, &end, 10);
    187195        if(*end != '\0') return false;
    188         if(r > (size_t)MAX) return false;
    189 
    190         value = r;
    191         return true;
     196        if(r > (unsigned long)MAX) return false;
     197
     198        value = r;
     199        return true;
     200}
     201
     202bool parse(const char * arg, unsigned long long & value) {
     203        char * end;
     204        unsigned long long int r = strtoull(arg, &end, 10);
     205        if(*end != '\0') return false;
     206        if(r > (unsigned long long)MAX) return false;
     207
     208        value = r;
     209        return true;
    192210}
    193211
  • libcfa/src/parseargs.hfa

    r5bcdc8c rcd02108  
    3131}
    3232
     33void parse_args( cfa_option options[], size_t opt_count, const char * usage, char ** & left );
    3334void parse_args( int argc, char * argv[], cfa_option options[], size_t opt_count, const char * usage, char ** & left );
    3435
     
    4041bool parse(const char *, int & );
    4142bool parse(const char *, unsigned & );
    42 bool parse(const char *, size_t & );
     43bool parse(const char *, unsigned long & );
     44bool parse(const char *, unsigned long long & );
    4345bool parse(const char *, double & );
Note: See TracChangeset for help on using the changeset viewer.