Changeset 4fe6224
- Timestamp:
- Aug 15, 2020, 12:03:20 AM (4 years ago)
- 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. - Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/prelude/bootloader.cf
r74807be r4fe6224 1 1 extern "C" { static inline int invoke_main(int argc, char* argv[], char* envp[]); } 2 int cfa_args_argc; 3 char ** cfa_args_argv; 4 char ** cfa_args_envp; 2 5 3 6 int main(int argc, char* argv[], char* envp[]) { 7 cfa_args_argc = argc; 8 cfa_args_argv = argv; 9 cfa_args_envp = envp; 4 10 return invoke_main(argc, argv, envp); 5 11 } -
libcfa/src/concurrency/kernel.cfa
r74807be r4fe6224 532 532 unsigned total = this.total; 533 533 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); 534 536 if(l != __atomic_load_n(&this.lock, __ATOMIC_SEQ_CST)) { Pause(); continue; } 535 537 return [idle, total, proc]; -
libcfa/src/parseargs.cfa
r74807be r4fe6224 24 24 #include "limits.hfa" 25 25 26 extern int cfa_args_argc; 27 extern char ** cfa_args_argv; 28 extern char ** cfa_args_envp; 29 26 30 void printopt(FILE * out, int width, int max, char sn, const char * ln, const char * help) { 27 31 int hwidth = max - (11 + width); … … 34 38 fprintf(out, "%*s%.*s\n", width + 11, "", hwidth, help); 35 39 } 40 } 41 42 void 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 ); 36 44 } 37 45 … … 172 180 } 173 181 174 bool parse(const char * arg, size_t& value) {182 bool parse(const char * arg, unsigned long & value) { 175 183 char * end; 176 184 unsigned long long int r = strtoull(arg, &end, 10); 177 185 if(*end != '\0') return false; 178 if(r > ( size_t)MAX) return false;186 if(r > (unsigned long)MAX) return false; 179 187 180 188 value = r; 181 189 return true; 190 } 191 192 bool 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; 182 200 } 183 201 -
libcfa/src/parseargs.hfa
r74807be r4fe6224 31 31 } 32 32 33 void parse_args( cfa_option options[], size_t opt_count, const char * usage, char ** & left ); 33 34 void parse_args( int argc, char * argv[], cfa_option options[], size_t opt_count, const char * usage, char ** & left ); 34 35 … … 39 40 bool parse(const char *, const char * & ); 40 41 bool parse(const char *, unsigned & ); 41 bool parse(const char *, size_t & ); 42 bool parse(const char *, unsigned long & ); 43 bool parse(const char *, unsigned long long & ); 42 44 bool parse(const char *, int & ); -
tests/.expect/declarationSpecifier.x64.txt
r74807be r4fe6224 1129 1129 static 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); } 1130 1130 static inline signed int invoke_main(signed int argc, char **argv, char **envp); 1131 signed int _X13cfa_args_argci_1; 1132 char **_X13cfa_args_argvPPc_1; 1133 char **_X13cfa_args_envpPPc_1; 1131 1134 signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){ 1132 1135 __attribute__ ((unused)) signed int _X12_retval_maini_1; 1133 1136 { 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 { 1134 1149 signed int _tmp_cp_ret4; 1135 1150 ((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 1129 1129 static 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); } 1130 1130 static inline signed int invoke_main(signed int argc, char **argv, char **envp); 1131 signed int _X13cfa_args_argci_1; 1132 char **_X13cfa_args_argvPPc_1; 1133 char **_X13cfa_args_envpPPc_1; 1131 1134 signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){ 1132 1135 __attribute__ ((unused)) signed int _X12_retval_maini_1; 1133 1136 { 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 { 1134 1149 signed int _tmp_cp_ret4; 1135 1150 ((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 321 321 static 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); } 322 322 static inline signed int invoke_main(signed int argc, char **argv, char **envp); 323 signed int _X13cfa_args_argci_1; 324 char **_X13cfa_args_argvPPc_1; 325 char **_X13cfa_args_envpPPc_1; 323 326 signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){ 324 327 __attribute__ ((unused)) signed int _X12_retval_maini_1; 325 328 { 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 { 326 341 signed int _tmp_cp_ret4; 327 342 ((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 299 299 static 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); } 300 300 static inline signed int invoke_main(signed int argc, char **argv, char **envp); 301 signed int _X13cfa_args_argci_1; 302 char **_X13cfa_args_argvPPc_1; 303 char **_X13cfa_args_envpPPc_1; 301 304 signed int main(signed int _X4argci_1, char **_X4argvPPc_1, char **_X4envpPPc_1){ 302 305 __attribute__ ((unused)) signed int _X12_retval_maini_1; 303 306 { 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 { 304 319 signed int _tmp_cp_ret4; 305 320 ((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 246 246 # transform path to canonical form 247 247 def canonical_path(path): 248 abspath = os.path.abspath( __main__.__file__)248 abspath = os.path.abspath(os.path.realpath(__main__.__file__)) 249 249 dname = os.path.dirname(abspath) 250 250 return os.path.join(dname, os.path.normpath(path) )
Note: See TracChangeset
for help on using the changeset viewer.