Changeset 4fe6224


Ignore:
Timestamp:
Aug 15, 2020, 12:03:20 AM (4 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
ef9988b
Parents:
74807be (diff), fb0ae06 (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 'new-ast' of plg.uwaterloo.ca:software/cfa/cfa-cc into new-ast

Files:
9 edited

Legend:

Unmodified
Added
Removed
  • libcfa/prelude/bootloader.cf

    r74807be r4fe6224  
    11extern "C" { static inline int invoke_main(int argc, char* argv[], char* envp[]); }
     2int cfa_args_argc;
     3char ** cfa_args_argv;
     4char ** cfa_args_envp;
    25
    36int main(int argc, char* argv[], char* envp[]) {
     7        cfa_args_argc = argc;
     8        cfa_args_argv = argv;
     9        cfa_args_envp = envp;
    410        return invoke_main(argc, argv, envp);
    511}
  • libcfa/src/concurrency/kernel.cfa

    r74807be r4fe6224  
    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

    r74807be r4fe6224  
    2424#include "limits.hfa"
    2525
     26extern int cfa_args_argc;
     27extern char ** cfa_args_argv;
     28extern char ** cfa_args_envp;
     29
    2630void printopt(FILE * out, int width, int max, char sn, const char * ln, const char * help) {
    2731        int hwidth = max - (11 + width);
     
    3438                fprintf(out, "%*s%.*s\n", width + 11, "", hwidth, help);
    3539        }
     40}
     41
     42void parse_args( cfa_option options[], size_t opt_count, const char * usage, char ** & left ) {
     43        parse_args(cfa_args_argc, cfa_args_argv, options, opt_count, usage, left );
    3644}
    3745
     
    172180}
    173181
    174 bool parse(const char * arg, size_t & value) {
     182bool parse(const char * arg, unsigned long & value) {
    175183        char * end;
    176184        unsigned long long int r = strtoull(arg, &end, 10);
    177185        if(*end != '\0') return false;
    178         if(r > (size_t)MAX) return false;
     186        if(r > (unsigned long)MAX) return false;
    179187
    180188        value = r;
    181189        return true;
     190}
     191
     192bool parse(const char * arg, unsigned long long & value) {
     193        char * end;
     194        unsigned long long int r = strtoull(arg, &end, 10);
     195        if(*end != '\0') return false;
     196        if(r > (unsigned long long)MAX) return false;
     197
     198        value = r;
     199        return true;
    182200}
    183201
  • libcfa/src/parseargs.hfa

    r74807be r4fe6224  
    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
     
    3940bool parse(const char *, const char * & );
    4041bool parse(const char *, unsigned & );
    41 bool parse(const char *, size_t & );
     42bool parse(const char *, unsigned long & );
     43bool parse(const char *, unsigned long long & );
    4244bool parse(const char *, int & );
  • tests/.expect/declarationSpecifier.x64.txt

    r74807be r4fe6224  
    11291129static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return _X4mainFi_iPPKc__1((signed int )argc, (const char **)argv); }
    11301130static inline signed int invoke_main(signed int argc, char **argv, char **envp);
     1131signed int _X13cfa_args_argci_1;
     1132char **_X13cfa_args_argvPPc_1;
     1133char **_X13cfa_args_envpPPc_1;
    11311134signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){
    11321135    __attribute__ ((unused)) signed int _X12_retval_maini_1;
    11331136    {
     1137        ((void)(_X13cfa_args_argci_1=_X4argci_1));
     1138    }
     1139
     1140    {
     1141        ((void)(_X13cfa_args_argvPPc_1=_X4argvPPc_1));
     1142    }
     1143
     1144    {
     1145        ((void)(_X13cfa_args_envpPPc_1=_X4envpPPc_1));
     1146    }
     1147
     1148    {
    11341149        signed int _tmp_cp_ret4;
    11351150        ((void)(_X12_retval_maini_1=(((void)(_tmp_cp_ret4=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret4)) /* ?{} */);
  • tests/.expect/declarationSpecifier.x86.txt

    r74807be r4fe6224  
    11291129static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return _X4mainFi_iPPKc__1((signed int )argc, (const char **)argv); }
    11301130static inline signed int invoke_main(signed int argc, char **argv, char **envp);
     1131signed int _X13cfa_args_argci_1;
     1132char **_X13cfa_args_argvPPc_1;
     1133char **_X13cfa_args_envpPPc_1;
    11311134signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){
    11321135    __attribute__ ((unused)) signed int _X12_retval_maini_1;
    11331136    {
     1137        ((void)(_X13cfa_args_argci_1=_X4argci_1));
     1138    }
     1139
     1140    {
     1141        ((void)(_X13cfa_args_argvPPc_1=_X4argvPPc_1));
     1142    }
     1143
     1144    {
     1145        ((void)(_X13cfa_args_envpPPc_1=_X4envpPPc_1));
     1146    }
     1147
     1148    {
    11341149        signed int _tmp_cp_ret4;
    11351150        ((void)(_X12_retval_maini_1=(((void)(_tmp_cp_ret4=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret4)) /* ?{} */);
  • tests/.expect/gccExtensions.x64.txt

    r74807be r4fe6224  
    321321static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return _X4mainFi_iPPKc__1((signed int )argc, (const char **)argv); }
    322322static inline signed int invoke_main(signed int argc, char **argv, char **envp);
     323signed int _X13cfa_args_argci_1;
     324char **_X13cfa_args_argvPPc_1;
     325char **_X13cfa_args_envpPPc_1;
    323326signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){
    324327    __attribute__ ((unused)) signed int _X12_retval_maini_1;
    325328    {
     329        ((void)(_X13cfa_args_argci_1=_X4argci_1));
     330    }
     331
     332    {
     333        ((void)(_X13cfa_args_argvPPc_1=_X4argvPPc_1));
     334    }
     335
     336    {
     337        ((void)(_X13cfa_args_envpPPc_1=_X4envpPPc_1));
     338    }
     339
     340    {
    326341        signed int _tmp_cp_ret4;
    327342        ((void)(_X12_retval_maini_1=(((void)(_tmp_cp_ret4=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret4)) /* ?{} */);
  • tests/.expect/gccExtensions.x86.txt

    r74807be r4fe6224  
    299299static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return _X4mainFi_iPPKc__1((signed int )argc, (const char **)argv); }
    300300static inline signed int invoke_main(signed int argc, char **argv, char **envp);
     301signed int _X13cfa_args_argci_1;
     302char **_X13cfa_args_argvPPc_1;
     303char **_X13cfa_args_envpPPc_1;
    301304signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){
    302305    __attribute__ ((unused)) signed int _X12_retval_maini_1;
    303306    {
     307        ((void)(_X13cfa_args_argci_1=_X4argci_1));
     308    }
     309
     310    {
     311        ((void)(_X13cfa_args_argvPPc_1=_X4argvPPc_1));
     312    }
     313
     314    {
     315        ((void)(_X13cfa_args_envpPPc_1=_X4envpPPc_1));
     316    }
     317
     318    {
    304319        signed int _tmp_cp_ret4;
    305320        ((void)(_X12_retval_maini_1=(((void)(_tmp_cp_ret4=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret4)) /* ?{} */);
  • tests/pybin/tools.py

    r74807be r4fe6224  
    246246# transform path to canonical form
    247247def canonical_path(path):
    248         abspath = os.path.abspath(__main__.__file__)
     248        abspath = os.path.abspath(os.path.realpath(__main__.__file__))
    249249        dname = os.path.dirname(abspath)
    250250        return os.path.join(dname, os.path.normpath(path) )
Note: See TracChangeset for help on using the changeset viewer.