Changes in / [9d264e18:d6ad99e]
- Files:
-
- 1 deleted
- 16 edited
-
benchmark/rmit.py (modified) (3 diffs)
-
doc/theses/andrew_beach_MMath/features.tex (deleted)
-
libcfa/src/Makefile.am (modified) (1 diff)
-
libcfa/src/concurrency/locks.cfa (modified) (19 diffs)
-
libcfa/src/concurrency/locks.hfa (modified) (5 diffs)
-
libcfa/src/stdlib.cfa (modified) (3 diffs)
-
libcfa/src/stdlib.hfa (modified) (8 diffs)
-
src/AST/Convert.cpp (modified) (3 diffs)
-
src/AST/Pass.impl.hpp (modified) (1 diff)
-
src/AST/Pass.proto.hpp (modified) (1 diff)
-
src/InitTweak/GenInit.cc (modified) (1 diff)
-
src/ResolvExpr/Resolver.cc (modified) (2 diffs)
-
src/main.cc (modified) (1 diff)
-
tests/.expect/alloc-ERROR.txt (modified) (3 diffs)
-
tests/alloc.cfa (modified) (2 diffs)
-
tests/malloc.cfa (modified) (2 diffs)
-
tests/manipulatorsOutput3.cfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/rmit.py
r9d264e18 rd6ad99e 12 12 import datetime 13 13 import itertools 14 import json15 14 import os 16 15 import random … … 118 117 # ================================================================================ 119 118 # parse command line arguments 120 formats = ['raw', 'csv' , 'json']119 formats = ['raw', 'csv'] 121 120 parser = argparse.ArgumentParser(description='Python Script to implement R.M.I.T. testing : Randomized Multiple Interleaved Trials') 122 121 parser.add_argument('--list', help='List all the commands that would be run', action='store_true') 123 parser.add_argument('--format', help='How to print the result', choices=formats, default=' json')122 parser.add_argument('--format', help='How to print the result', choices=formats, default='csv') 124 123 parser.add_argument('--file', nargs='?', type=argparse.FileType('w'), default=sys.stdout) 125 124 parser.add_argument('-t', '--trials', help='Number of trials to run per combinaison', type=int, default=3) … … 204 203 205 204 # ================================================================================ 206 # Print raw205 # Print csv 207 206 if options.format == 'raw': 208 207 for r in result: 209 208 print(r, file=options.file) 210 sys.exit(0)211 212 # ================================================================================213 # Print json214 if options.format == 'json':215 json.dump(result, options.file)216 209 sys.exit(0) 217 210 -
libcfa/src/Makefile.am
r9d264e18 rd6ad99e 96 96 concurrency/exception.hfa \ 97 97 concurrency/kernel.hfa \ 98 concurrency/locks.hfa \99 98 concurrency/monitor.hfa \ 100 99 concurrency/mutex.hfa \ -
libcfa/src/concurrency/locks.cfa
r9d264e18 rd6ad99e 51 51 } 52 52 53 void ?{}( single_acquisition_lock & this ) {53 void ?{}( mutex_lock & this ) { 54 54 ((blocking_lock &)this){ false, false }; 55 55 } 56 56 57 void ^?{}( single_acquisition_lock & this ) {57 void ^?{}( mutex_lock & this ) { 58 58 // default 59 59 } … … 67 67 } 68 68 69 void ?{}( multiple_acquisition_lock & this ) {69 void ?{}( recursive_mutex_lock & this ) { 70 70 ((blocking_lock &)this){ true, false }; 71 71 } 72 72 73 void ^?{}( multiple_acquisition_lock & this ) {73 void ^?{}( recursive_mutex_lock & this ) { 74 74 // default 75 75 } 76 76 77 77 void lock( blocking_lock & this ) with( this ) { 78 $thread * thrd = active_thread(); 78 79 lock( lock __cfaabi_dbg_ctx2 ); 79 if ( owner == active_thread()&& !multi_acquisition) {80 if ( owner == thrd && !multi_acquisition) { 80 81 fprintf(stderr, "A single acquisition lock holder attempted to reacquire the lock resulting in a deadlock."); // Possibly throw instead 81 82 exit(EXIT_FAILURE); 82 } else if ( owner != 0p && owner != active_thread()) {83 append( blocked_threads, active_thread());83 } else if ( owner != 0p && owner != thrd ) { 84 append( blocked_threads, thrd ); 84 85 wait_count++; 85 86 unlock( lock ); 86 87 park( ); 87 } else if ( owner == active_thread()&& multi_acquisition ) {88 } else if ( owner == thrd && multi_acquisition ) { 88 89 recursion_count++; 89 90 unlock( lock ); 90 91 } else { 91 owner = active_thread();92 owner = thrd; 92 93 recursion_count = 1; 93 94 unlock( lock ); … … 96 97 97 98 bool try_lock( blocking_lock & this ) with( this ) { 99 $thread * thrd = active_thread(); 98 100 bool ret = false; 99 101 lock( lock __cfaabi_dbg_ctx2 ); 100 102 if ( owner == 0p ) { 101 owner = active_thread();102 recursion_count = 1;103 owner = thrd; 104 if ( multi_acquisition ) recursion_count = 1; 103 105 ret = true; 104 } else if ( owner == active_thread()&& multi_acquisition ) {106 } else if ( owner == thrd && multi_acquisition ) { 105 107 recursion_count++; 106 108 ret = true; … … 113 115 lock( lock __cfaabi_dbg_ctx2 ); 114 116 if ( owner == 0p ){ // no owner implies lock isn't held 115 fprintf( stderr, "There was an attempt to release a lock that isn't held" ); 117 fprintf( stderr, "There was an attempt to release a lock that isn't held" ); 116 118 return; 117 } else if ( strict_owner && owner !=active_thread() ) {118 fprintf( stderr, "A thread other than the owner attempted to release an owner lock" ); 119 } else if ( strict_owner && active_thread() ) { 120 fprintf( stderr, "A thread other than the owner attempted to release an owner lock" ); 119 121 return; 120 122 } … … 123 125 $thread * thrd = pop_head( blocked_threads ); 124 126 owner = thrd; 125 recursion_count = ( thrd ? 1 : 0 );127 recursion_count = ( thrd && multi_acquisition ? 1 : 0 ); 126 128 wait_count--; 127 129 unpark( thrd ); … … 151 153 } else { 152 154 owner = t; 153 recursion_count = 1;155 if ( multi_acquisition ) recursion_count = 1; 154 156 #if !defined( __CFA_NO_STATISTICS__ ) 155 //kernelTLS.this_stats = t->curr_cluster->stats;157 kernelTLS.this_stats = t->curr_cluster->stats; 156 158 #endif 157 159 unpark( t ); … … 163 165 lock( lock __cfaabi_dbg_ctx2 ); 164 166 if ( owner == 0p ){ // no owner implies lock isn't held 165 fprintf( stderr, "A lock that is not held was passed to a synchronization lock" ); 166 } else if ( strict_owner && owner !=active_thread() ) {167 fprintf( stderr, "A thread other than the owner of a lock passed it to a synchronization lock" ); 167 fprintf( stderr, "A lock that is not held was passed to a synchronization lock" ); 168 } else if ( strict_owner && active_thread() ) { 169 fprintf( stderr, "A thread other than the owner of a lock passed it to a synchronization lock" ); 168 170 } else { 169 171 $thread * thrd = pop_head( blocked_threads ); 170 172 owner = thrd; 171 recursion_count = ( thrd ? 1 : 0 );173 recursion_count = ( thrd && multi_acquisition ? 1 : 0 ); 172 174 wait_count--; 173 175 unpark( thrd ); … … 182 184 // This is temporary until an inheritance bug is fixed 183 185 184 void lock( single_acquisition_lock & this ){186 void lock( mutex_lock & this ){ 185 187 lock( (blocking_lock &)this ); 186 188 } 187 189 188 void unlock( single_acquisition_lock & this ){190 void unlock( mutex_lock & this ){ 189 191 unlock( (blocking_lock &)this ); 190 192 } 191 193 192 void add_( single_acquisition_lock & this, struct $thread * t ){194 void add_( mutex_lock & this, struct $thread * t ){ 193 195 add_( (blocking_lock &)this, t ); 194 196 } 195 197 196 void remove_( single_acquisition_lock & this ){198 void remove_( mutex_lock & this ){ 197 199 remove_( (blocking_lock &)this ); 198 200 } 199 201 200 void set_recursion_count( single_acquisition_lock & this, size_t recursion ){202 void set_recursion_count( mutex_lock & this, size_t recursion ){ 201 203 set_recursion_count( (blocking_lock &)this, recursion ); 202 204 } 203 205 204 size_t get_recursion_count( single_acquisition_lock & this ){205 returnget_recursion_count( (blocking_lock &)this );206 } 207 208 void lock( owner_lock & this ){206 size_t get_recursion_count( mutex_lock & this ){ 207 get_recursion_count( (blocking_lock &)this ); 208 } 209 210 void lock( recursive_mutex_lock & this ){ 209 211 lock( (blocking_lock &)this ); 210 212 } 211 213 212 void unlock( owner_lock & this ){214 void unlock( recursive_mutex_lock & this ){ 213 215 unlock( (blocking_lock &)this ); 214 216 } 215 217 216 void add_( owner_lock & this, struct $thread * t ){218 void add_( recursive_mutex_lock & this, struct $thread * t ){ 217 219 add_( (blocking_lock &)this, t ); 218 220 } 219 221 220 void remove_( owner_lock & this ){222 void remove_( recursive_mutex_lock & this ){ 221 223 remove_( (blocking_lock &)this ); 222 224 } 223 225 224 void set_recursion_count( owner_lock & this, size_t recursion ){226 void set_recursion_count( recursive_mutex_lock & this, size_t recursion ){ 225 227 set_recursion_count( (blocking_lock &)this, recursion ); 226 228 } 227 229 228 size_t get_recursion_count( owner_lock & this ){ 229 return get_recursion_count( (blocking_lock &)this ); 230 } 231 232 void lock( multiple_acquisition_lock & this ){ 233 lock( (blocking_lock &)this ); 234 } 235 236 void unlock( multiple_acquisition_lock & this ){ 237 unlock( (blocking_lock &)this ); 238 } 239 240 void add_( multiple_acquisition_lock & this, struct $thread * t ){ 241 add_( (blocking_lock &)this, t ); 242 } 243 244 void remove_( multiple_acquisition_lock & this ){ 245 remove_( (blocking_lock &)this ); 246 } 247 248 void set_recursion_count( multiple_acquisition_lock & this, size_t recursion ){ 249 set_recursion_count( (blocking_lock &)this, recursion ); 250 } 251 252 size_t get_recursion_count( multiple_acquisition_lock & this ){ 253 return get_recursion_count( (blocking_lock &)this ); 230 size_t get_recursion_count( recursive_mutex_lock & this ){ 231 get_recursion_count( (blocking_lock &)this ); 254 232 } 255 233 … … 266 244 info_thread(L) * copy = *i; 267 245 remove( cond->blocked_threads, i ); //remove this thread O(1) 268 cond-> count--;246 cond->wait_count--; 269 247 if( !copy->lock ) { 248 unlock( cond->lock ); 270 249 #if !defined( __CFA_NO_STATISTICS__ ) 271 //kernelTLS.this_stats = copy->t->curr_cluster->stats; 250 #warning unprotected access to tls TODO discuss this 251 kernelTLS.this_stats = copy->t->curr_cluster->stats; 272 252 #endif 273 253 unpark( copy->t ); … … 305 285 bool ret = !!blocked_threads; 306 286 info_thread(L) * popped = pop_head( blocked_threads ); 287 popped->listed = false; 307 288 if(popped != 0p) { 308 popped->listed = false;309 289 count--; 310 290 if (popped->lock) { … … 323 303 while( blocked_threads ) { 324 304 info_thread(L) * popped = pop_head( blocked_threads ); 305 popped->listed = false; 325 306 if(popped != 0p){ 326 popped->listed = false;327 307 count--; 328 308 if (popped->lock) { … … 361 341 remove_( *i.lock ); 362 342 } 363 343 364 344 unlock( lock ); 365 345 park( ); // blocks here … … 405 385 queue_info_thread( this, i ); 406 386 } 407 387 408 388 void wait( condition_variable(L) & this, Duration duration ) with(this) { 409 389 info_thread( L ) i = { active_thread() }; … … 411 391 } 412 392 413 void wait( condition_variable(L) & this, uintptr_t info, Duration duration ) with(this) { 393 void wait( condition_variable(L) & this, uintptr_t info, Duration duration ) with(this) { 414 394 info_thread( L ) i = { active_thread(), info }; 415 395 queue_info_thread_timeout(this, i, __kernel_get_time() + duration ); … … 437 417 queue_info_thread( this, i ); 438 418 } 439 419 440 420 void wait( condition_variable(L) & this, L & l, Duration duration ) with(this) { 441 421 info_thread(L) i = { active_thread() }; … … 443 423 queue_info_thread_timeout(this, i, __kernel_get_time() + duration ); 444 424 } 445 425 446 426 void wait( condition_variable(L) & this, L & l, uintptr_t info, Duration duration ) with(this) { 447 427 info_thread(L) i = { active_thread(), info }; … … 449 429 queue_info_thread_timeout(this, i, __kernel_get_time() + duration ); 450 430 } 451 431 452 432 void wait( condition_variable(L) & this, L & l, Time time ) with(this) { 453 433 info_thread(L) i = { active_thread() }; … … 455 435 queue_info_thread_timeout(this, i, time ); 456 436 } 457 437 458 438 void wait( condition_variable(L) & this, L & l, uintptr_t info, Time time ) with(this) { 459 439 info_thread(L) i = { active_thread(), info }; … … 462 442 } 463 443 } 464 465 // thread T1 {};466 // thread T2 {};467 468 // multiple_acquisition_lock m;469 // condition_variable( multiple_acquisition_lock ) c;470 471 // void main( T1 & this ) {472 // printf("T1 start\n");473 // lock(m);474 // printf("%d\n", counter(c));475 // if(empty(c)) {476 // printf("T1 wait\n");477 // wait(c,m,12);478 // }else{479 // printf("%d\n", front(c));480 // notify_one(c);481 // }482 // unlock(m);483 // printf("curr thd in main %p \n", active_thread());484 // printf("T1 waits for 2s\n");485 // lock(m);486 // wait( c, m, 2`s );487 // unlock(m);488 // printf("T1 wakes\n");489 // printf("T1 done\n");490 // }491 492 // void main( T2 & this ) {493 // printf("T2 start\n");494 // lock(m);495 // printf("%d\n", counter(c));496 // if(empty(c)) {497 // printf("T2 wait\n");498 // wait(c,m,12);499 // }else{500 // printf("%d\n", front(c));501 // notify_one(c);502 // }503 // unlock(m);504 // printf("T2 done\n");505 // }506 507 // int main() {508 // printf("start\n");509 // processor p[2];510 // {511 // T1 t1;512 // T2 t2;513 // }514 // printf("done\n");515 // } -
libcfa/src/concurrency/locks.hfa
r9d264e18 rd6ad99e 49 49 //// Blocking Locks 50 50 /////////////////////////////////////////////////////////////////// 51 52 51 struct blocking_lock { 53 52 // Spin lock used for mutual exclusion … … 73 72 }; 74 73 75 struct single_acquisition_lock {74 struct mutex_lock { 76 75 inline blocking_lock; 77 76 }; … … 81 80 }; 82 81 83 struct multiple_acquisition_lock {82 struct recursive_mutex_lock { 84 83 inline blocking_lock; 85 84 }; … … 88 87 void ^?{}( blocking_lock & this ); 89 88 90 void ?{}( single_acquisition_lock & this );91 void ^?{}( single_acquisition_lock & this );89 void ?{}( mutex_lock & this ); 90 void ^?{}( mutex_lock & this ); 92 91 93 92 void ?{}( owner_lock & this ); 94 93 void ^?{}( owner_lock & this ); 95 94 96 void ?{}( multiple_acquisition_lock & this );97 void ^?{}( multiple_acquisition_lock & this );95 void ?{}( recursive_mutex_lock & this ); 96 void ^?{}( recursive_mutex_lock & this ); 98 97 99 98 void lock( blocking_lock & this ); … … 106 105 size_t get_recursion_count( blocking_lock & this ); 107 106 108 void lock( single_acquisition_lock & this );109 void unlock( single_acquisition_lock & this );110 void add_( single_acquisition_lock & this, struct $thread * t );111 void remove_( single_acquisition_lock & this );112 void set_recursion_count( single_acquisition_lock & this, size_t recursion );113 size_t get_recursion_count( single_acquisition_lock & this );107 void lock( mutex_lock & this ); 108 void unlock( mutex_lock & this ); 109 void add_( mutex_lock & this, struct $thread * t ); 110 void remove_( mutex_lock & this ); 111 void set_recursion_count( mutex_lock & this, size_t recursion ); 112 size_t get_recursion_count( mutex_lock & this ); 114 113 115 void lock( owner_lock & this ); 116 void unlock( owner_lock & this ); 117 void add_( owner_lock & this, struct $thread * t ); 118 void remove_( owner_lock & this ); 119 void set_recursion_count( owner_lock & this, size_t recursion ); 120 size_t get_recursion_count( owner_lock & this ); 121 122 void lock( multiple_acquisition_lock & this ); 123 void unlock( multiple_acquisition_lock & this ); 124 void add_( multiple_acquisition_lock & this, struct $thread * t ); 125 void remove_( multiple_acquisition_lock & this ); 126 void set_recursion_count( multiple_acquisition_lock & this, size_t recursion ); 127 size_t get_recursion_count( multiple_acquisition_lock & this ); 114 void lock( recursive_mutex_lock & this ); 115 void unlock( recursive_mutex_lock & this ); 116 void add_( recursive_mutex_lock & this, struct $thread * t ); 117 void remove_( recursive_mutex_lock & this ); 118 void set_recursion_count( recursive_mutex_lock & this, size_t recursion ); 119 size_t get_recursion_count( recursive_mutex_lock & this ); 128 120 129 121 /////////////////////////////////////////////////////////////////// -
libcfa/src/stdlib.cfa
r9d264e18 rd6ad99e 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Nov 12 07:46:09202013 // Update Count : 50 312 // Last Modified On : Sun Jul 19 15:05:28 2020 13 // Update Count : 501 14 14 // 15 15 … … 26 26 //--------------------------------------- 27 27 28 // Cforall allocation/deallocation and constructor/destructor, array types 29 30 forall( dtype T | sized(T), ttype TT | { void ?{}( T &, TT ); } ) 31 T * anew( size_t dim, TT p ) { 28 // allocation/deallocation and constructor/destructor, non-array types 29 forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) 30 T * new( Params p ) { 31 return &(*malloc()){ p }; // run constructor 32 } // new 33 34 forall( dtype T | { void ^?{}( T & ); } ) 35 void delete( T * ptr ) { 36 if ( ptr ) { // ignore null 37 ^(*ptr){}; // run destructor 38 free( ptr ); 39 } // if 40 } // delete 41 42 forall( dtype T, ttype Params | { void ^?{}( T & ); void delete( Params ); } ) 43 void delete( T * ptr, Params rest ) { 44 delete( ptr ); 45 delete( rest ); 46 } // delete 47 48 49 // allocation/deallocation and constructor/destructor, array types 50 forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) 51 T * anew( size_t dim, Params p ) { 32 52 T * arr = alloc( dim ); 33 53 for ( unsigned int i = 0; i < dim; i += 1 ) { … … 48 68 } // adelete 49 69 50 forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype TT | { void adelete( TT); } )51 void adelete( T arr[], TTrest ) {70 forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype Params | { void adelete( Params ); } ) 71 void adelete( T arr[], Params rest ) { 52 72 if ( arr ) { // ignore null 53 73 size_t dim = malloc_size( arr ) / sizeof( T ); -
libcfa/src/stdlib.hfa
r9d264e18 rd6ad99e 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Nov 12 08:12:08202013 // Update Count : 5 1512 // Last Modified On : Tue Sep 1 20:32:34 2020 13 // Update Count : 505 14 14 // 15 15 16 16 #pragma once 17 17 18 #include "bits/defs.hfa" // OPTIONAL_THREAD19 #include "bits/align.hfa" // libAlign18 #include "bits/defs.hfa" 19 #include "bits/align.hfa" 20 20 21 21 #include <stdlib.h> // *alloc, strto*, ato* … … 107 107 } // distribution 108 108 109 static inline forall( ttype TT | { void free( TT ); } ) { 110 // T* does not take void* and vice-versa 111 112 void free( void * addr, TT rest ) { 113 free( addr ); 114 free( rest ); 115 } // free 116 117 forall( dtype T | sized(T) ) 118 void free( T * addr, TT rest ) { 119 free( addr ); 120 free( rest ); 121 } // free 122 } // distribution 123 109 124 /* 110 125 FIX ME : fix alloc interface after Ticker Number 214 is resolved, define and add union to S_fill. Then, modify postfix-fill functions to support T * with nmemb, char, and T object of any size. Finally, change alloc_internal. … … 114 129 forall( dtype T | sized(T) ) { 115 130 union U_fill { char c; T * a; T t; }; 116 struct S_fill { char tag; U_fill(T) fill; };131 struct S_fill { char tag; char c; size_t size; T * at; char t[50]; }; 117 132 struct S_realloc { inline T *; }; 118 133 } … … 162 177 static inline T_align ?`align ( size_t a ) { return (T_align){a}; } 163 178 static inline T_resize ?`resize ( void * a ) { return (T_resize){a}; } 164 165 179 static inline forall( dtype T | sized(T) ) { 180 166 181 S_fill(T) ?`fill ( T t ) { 167 182 S_fill(T) ret = { 't' }; … … 235 250 236 251 } // distribution TT 252 237 253 } // distribution T 238 254 … … 246 262 return (T *)memcpy( dest, src, sizeof(T) ); 247 263 } // memcpy 248 264 } // distribution 265 266 static inline forall( dtype T | sized(T) ) { 249 267 // Cforall safe initialization/copy, i.e., implicit size specification, array types 250 268 T * amemset( T dest[], char fill, size_t dim ) { … … 257 275 } // distribution 258 276 259 // Cforall deallocation for multiple objects260 static inline forall( dtype T, ttype TT | { void free( TT ); } )261 void free( T * addr, TT rest ) {262 free( addr );263 free( rest );264 } // free265 266 277 // Cforall allocation/deallocation and constructor/destructor, non-array types 267 static inline forall( dtype T | sized(T), ttype TT | { void ?{}( T &, TT ); } ) 268 T * new( TT p ) { 269 return &(*malloc()){ p }; // run constructor 270 } // new 271 272 static inline forall( dtype T | { void ^?{}( T & ); } ) 273 void delete( T * ptr ) { 274 if ( ptr ) { // ignore null 275 ^(*ptr){}; // run destructor 276 free( ptr ); 277 } // if 278 } // delete 279 280 static inline forall( dtype T, ttype TT | { void ^?{}( T & ); void delete( TT ); } ) 281 void delete( T * ptr, TT rest ) { 282 delete( ptr ); 283 delete( rest ); 284 } // delete 278 forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) T * new( Params p ); 279 forall( dtype T | { void ^?{}( T & ); } ) void delete( T * ptr ); 280 forall( dtype T, ttype Params | { void ^?{}( T & ); void delete( Params ); } ) void delete( T * ptr, Params rest ); 285 281 286 282 // Cforall allocation/deallocation and constructor/destructor, array types 287 forall( dtype T | sized(T), ttype TT | { void ?{}( T &, TT ); } ) T * anew( size_t dim, TTp );283 forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) T * anew( size_t dim, Params p ); 288 284 forall( dtype T | sized(T) | { void ^?{}( T & ); } ) void adelete( T arr[] ); 289 forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype TT | { void adelete( TT ); } ) void adelete( T arr[], TTrest );285 forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype Params | { void adelete( Params ); } ) void adelete( T arr[], Params rest ); 290 286 291 287 //--------------------------------------- … … 383 379 //--------------------------------------- 384 380 385 extern bool threading_enabled( void) OPTIONAL_THREAD;381 extern bool threading_enabled(void) OPTIONAL_THREAD; 386 382 387 383 // Local Variables: // -
src/AST/Convert.cpp
r9d264e18 rd6ad99e 9 9 // Author : Thierry Delisle 10 10 // Created On : Thu May 09 15::37::05 2019 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr Nov 12 10:07:00 202013 // Update Count : 3 411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 11 21:39:32 2019 13 // Update Count : 33 14 14 // 15 15 … … 187 187 auto init = get<Initializer>().accept1( node->init ); 188 188 decl->init = init; 189 189 190 190 this->node = decl; 191 191 return nullptr; … … 2812 2812 } 2813 2813 deleteAll(translationUnit); 2814 2815 // Load the local static varables into the global store.2816 unit.global.sizeType = ast::sizeType;2817 unit.global.dereference = ast::dereferenceOperator;2818 unit.global.dtorStruct = ast::dtorStruct;2819 unit.global.dtorDestroy = ast::dtorStructDestroy;2820 2821 2814 return unit; 2822 2815 } -
src/AST/Pass.impl.hpp
r9d264e18 rd6ad99e 423 423 } 424 424 catch( SemanticErrorException &e ) { 425 if (__pass::on _error (visitor.core, *i, 0))425 if (__pass::onError (visitor.core, *i, 0)) 426 426 errors.append( e ); 427 427 } -
src/AST/Pass.proto.hpp
r9d264e18 rd6ad99e 270 270 271 271 template< typename core_t > 272 static bool on _error (core_t &, ptr<Decl> &, long) { return true; }273 274 template< typename core_t > 275 static auto on _error (core_t & core, ptr<Decl> & decl, int) -> decltype(core.on_error(decl)) {276 return core.on _error(decl);272 static bool onError (core_t &, ptr<Decl> &, long) { return true; } 273 274 template< typename core_t > 275 static auto onError (core_t & core, ptr<Decl> & decl, int) -> decltype(core.onError(decl)) { 276 return core.onError(decl); 277 277 } 278 278 -
src/InitTweak/GenInit.cc
r9d264e18 rd6ad99e 202 202 } 203 203 // don't need to hoist dimension if it's definitely pure - only need to if there's potential for side effects. 204 // xxx - hoisting has no side effects anyways, so don't skip since we delay resolve 205 // still try to detect constant expressions 206 if ( ! Tuples::maybeImpure( arrayType->dimension ) ) return; 204 // xxx - hoisting has no side effects anyways, so don't skip since we delay resolve 205 // only skip in the most trivial case, which does not require resolve 206 if (dynamic_cast<ConstantExpr *>(arrayType->dimension)) return; 207 // if ( ! Tuples::maybeImpure( arrayType->dimension ) ) return; 207 208 208 209 ObjectDecl * arrayDimension = new ObjectDecl( dimensionName.newName(), storageClasses, LinkageSpec::C, 0, Validate::SizeType->clone(), new SingleInit( arrayType->get_dimension() ) ); -
src/ResolvExpr/Resolver.cc
r9d264e18 rd6ad99e 1289 1289 void beginScope() { managedTypes.beginScope(); } 1290 1290 void endScope() { managedTypes.endScope(); } 1291 bool on _error(ast::ptr<ast::Decl> & decl);1291 bool onError(ast::ptr<ast::Decl> & decl); 1292 1292 }; 1293 1293 // size_t Resolver_new::traceId = Stats::Heap::new_stacktrace_id("Resolver"); … … 2068 2068 2069 2069 // suppress error on autogen functions and mark invalid autogen as deleted. 2070 bool Resolver_new::on _error(ast::ptr<ast::Decl> & decl) {2070 bool Resolver_new::onError(ast::ptr<ast::Decl> & decl) { 2071 2071 if (auto functionDecl = decl.as<ast::FunctionDecl>()) { 2072 2072 // xxx - can intrinsic gen ever fail? -
src/main.cc
r9d264e18 rd6ad99e 341 341 342 342 if( useNewAST) { 343 if (Stats::Counters::enabled) {344 ast::pass_visitor_stats.avg = Stats::Counters::build<Stats::Counters::AverageCounter<double>>("Average Depth - New");345 ast::pass_visitor_stats.max = Stats::Counters::build<Stats::Counters::MaxCounter<double>>("Max depth - New");346 }347 343 auto transUnit = convert( move( translationUnit ) ); 348 344 PASS( "Resolve", ResolvExpr::resolve( transUnit ) ); -
tests/.expect/alloc-ERROR.txt
r9d264e18 rd6ad99e 1 alloc.cfa:3 82:1 error: No reasonable alternatives for expression Applying untyped:1 alloc.cfa:361:1 error: No reasonable alternatives for expression Applying untyped: 2 2 Name: ?=? 3 3 ...to: … … 19 19 20 20 21 alloc.cfa:3 83:1 error: No reasonable alternatives for expression Applying untyped:21 alloc.cfa:362:1 error: No reasonable alternatives for expression Applying untyped: 22 22 Name: ?=? 23 23 ...to: … … 30 30 31 31 32 alloc.cfa:3 84:1 error: No reasonable alternatives for expression Applying untyped:32 alloc.cfa:363:1 error: No reasonable alternatives for expression Applying untyped: 33 33 Name: ?=? 34 34 ...to: -
tests/alloc.cfa
r9d264e18 rd6ad99e 10 10 // Created On : Wed Feb 3 07:56:22 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Nov 12 10:02:18202013 // Update Count : 43 212 // Last Modified On : Fri Oct 9 23:03:11 2020 13 // Update Count : 431 14 14 // 15 15 … … 375 375 dp = alloc(5.0`fill); // just for testing multiple free 376 376 assert(*dp == 5.0); 377 free( ip, dp , 0p);377 free( ip, dp ); 378 378 379 379 #ifdef ERR1 -
tests/malloc.cfa
r9d264e18 rd6ad99e 319 319 free(ip); 320 320 321 free( (void *) 0p ); // sanity check321 free( (void*) 0p ); // sanity check 322 322 free( NULL ); // sanity check 323 323 … … 605 605 return 0; 606 606 } 607 608 // Local Variables: //609 // tab-width: 4 //610 // compile-command: "cfa malloc.cfa" //611 // End: // -
tests/manipulatorsOutput3.cfa
r9d264e18 rd6ad99e 156 156 sout | nl; 157 157 158 ui128 = 0x7fffffffffffffff; 159 ui128 <<= 64; 160 ui128 += 0xffffffffffffffff; 158 161 sout | left( wd( 160, i128 ) ); 159 162 sout | left( sign( wd( 0, i128 ) ) ); … … 174 177 sout | left( wd( 160, bin( i128 ) ) ); 175 178 sout | left( sign( wd( 160, i128 ) ) ); 176 sout | left( wd( 160, upcase( hex( i128 )) ) );177 sout | left( wd( 160, upcase( oct( i128 ) )) );178 sout | left( wd( 160, upcase( bin( i128 )) ) );179 sout | left( wd( 160, upcase(hex( i128 )) ) ); 180 sout | left( wd( 160, upcase(oct( i128 ) )) ); 181 sout | left( wd( 160, upcase(bin( i128 )) ) ); 179 182 180 183 x = 1234; … … 313 316 } 314 317 318 315 319 // int128 constants (and printing) 316 320 int128 v = 0xffff_ffffffff_ffffffff_L128 + 0xffffffff_ffffffff_ffffffff_ffffffff_L128;
Note:
See TracChangeset
for help on using the changeset viewer.