Changeset e84ab3d for src/Concurrency/Keywords.cc
- Timestamp:
- Jul 5, 2021, 4:44:20 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 7f62b708
- Parents:
- ee23a8d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Keywords.cc
ree23a8d re84ab3d 122 122 // int data; int data; 123 123 // a_struct_t more_data; a_struct_t more_data; 124 // => $thread__thrd_d;124 // => thread$ __thrd_d; 125 125 // }; }; 126 // static inline $thread* get_thread( MyThread * this ) { return &this->__thrd_d; }126 // static inline thread$ * get_thread( MyThread * this ) { return &this->__thrd_d; } 127 127 // 128 128 class ThreadKeyword final : public ConcurrentSueKeyword { … … 130 130 131 131 ThreadKeyword() : ConcurrentSueKeyword( 132 " $thread",132 "thread$", 133 133 "__thrd", 134 134 "get_thread", … … 155 155 // int data; int data; 156 156 // a_struct_t more_data; a_struct_t more_data; 157 // => $coroutine__cor_d;157 // => coroutine$ __cor_d; 158 158 // }; }; 159 // static inline $coroutine* get_coroutine( MyCoroutine * this ) { return &this->__cor_d; }159 // static inline coroutine$ * get_coroutine( MyCoroutine * this ) { return &this->__cor_d; } 160 160 // 161 161 class CoroutineKeyword final : public ConcurrentSueKeyword { … … 163 163 164 164 CoroutineKeyword() : ConcurrentSueKeyword( 165 " $coroutine",165 "coroutine$", 166 166 "__cor", 167 167 "get_coroutine", … … 190 190 // int data; int data; 191 191 // a_struct_t more_data; a_struct_t more_data; 192 // => $monitor__mon_d;192 // => monitor$ __mon_d; 193 193 // }; }; 194 // static inline $monitor* get_coroutine( MyMonitor * this ) { return &this->__cor_d; }194 // static inline monitor$ * get_coroutine( MyMonitor * this ) { return &this->__cor_d; } 195 195 // 196 196 class MonitorKeyword final : public ConcurrentSueKeyword { … … 198 198 199 199 MonitorKeyword() : ConcurrentSueKeyword( 200 " $monitor",200 "monitor$", 201 201 "__mon", 202 202 "get_monitor", … … 230 230 231 231 GeneratorKeyword() : ConcurrentSueKeyword( 232 " $generator",232 "generator$", 233 233 "__generator_state", 234 234 "get_generator", 235 "Unable to find builtin type $generator\n",235 "Unable to find builtin type generator$\n", 236 236 "", 237 237 true, … … 292 292 //Handles mutex routines definitions : 293 293 // void foo( A * mutex a, B * mutex b, int i ) { void foo( A * a, B * b, int i ) { 294 // $monitor* __monitors[] = { get_monitor(a), get_monitor(b) };294 // monitor$ * __monitors[] = { get_monitor(a), get_monitor(b) }; 295 295 // monitor_guard_t __guard = { __monitors, 2 }; 296 296 // /*Some code*/ => /*Some code*/ … … 333 333 //Handles mutex routines definitions : 334 334 // void foo( A * mutex a, B * mutex b, int i ) { void foo( A * a, B * b, int i ) { 335 // $monitor* __monitors[] = { get_monitor(a), get_monitor(b) };335 // monitor$ * __monitors[] = { get_monitor(a), get_monitor(b) }; 336 336 // monitor_guard_t __guard = { __monitors, 2 }; 337 337 // /*Some code*/ => /*Some code*/ … … 449 449 Expression * ConcurrentSueKeyword::postmutate( KeywordCastExpr * cast ) { 450 450 if ( cast_target == cast->target ) { 451 // convert (thread &)t to ( $thread&)*get_thread(t), etc.451 // convert (thread &)t to (thread$ &)*get_thread(t), etc. 452 452 if( !type_decl ) SemanticError( cast, context_error ); 453 453 if( !dtor_decl ) SemanticError( cast, context_error ); … … 919 919 void MutexKeyword::postvisit(StructDecl* decl) { 920 920 921 if( decl->name == " $monitor" && decl->body ) {921 if( decl->name == "monitor$" && decl->body ) { 922 922 assert( !monitor_decl ); 923 923 monitor_decl = decl; … … 1020 1020 ); 1021 1021 1022 // $monitor* __monitors[] = { get_monitor(a), get_monitor(b) };1022 //monitor$ * __monitors[] = { get_monitor(a), get_monitor(b) }; 1023 1023 body->push_front( new DeclStmt( monitors ) ); 1024 1024 } … … 1117 1117 ); 1118 1118 1119 // $monitor* __monitors[] = { get_monitor(a), get_monitor(b) };1119 //monitor$ * __monitors[] = { get_monitor(a), get_monitor(b) }; 1120 1120 body->push_front( new DeclStmt( monitors) ); 1121 1121 } … … 1125 1125 //============================================================================================= 1126 1126 void ThreadStarter::previsit( StructDecl * decl ) { 1127 if( decl->name == " $thread" && decl->body ) {1127 if( decl->name == "thread$" && decl->body ) { 1128 1128 assert( !thread_decl ); 1129 1129 thread_decl = decl;
Note: See TracChangeset
for help on using the changeset viewer.