Ignore:
Timestamp:
Jul 5, 2021, 4:44:20 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
7f62b708
Parents:
ee23a8d
Message:

Step 1 of changing $thread to thread$

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    ree23a8d re84ab3d  
    122122        //      int data;                                  int data;
    123123        //      a_struct_t more_data;                      a_struct_t more_data;
    124         //                                =>             $thread __thrd_d;
     124        //                                =>             thread$ __thrd_d;
    125125        // };                                        };
    126         //                                           static inline $thread * get_thread( MyThread * this ) { return &this->__thrd_d; }
     126        //                                           static inline thread$ * get_thread( MyThread * this ) { return &this->__thrd_d; }
    127127        //
    128128        class ThreadKeyword final : public ConcurrentSueKeyword {
     
    130130
    131131                ThreadKeyword() : ConcurrentSueKeyword(
    132                         "$thread",
     132                        "thread$",
    133133                        "__thrd",
    134134                        "get_thread",
     
    155155        //      int data;                                  int data;
    156156        //      a_struct_t more_data;                      a_struct_t more_data;
    157         //                                =>             $coroutine __cor_d;
     157        //                                =>             coroutine$ __cor_d;
    158158        // };                                        };
    159         //                                           static inline $coroutine * get_coroutine( MyCoroutine * this ) { return &this->__cor_d; }
     159        //                                           static inline coroutine$ * get_coroutine( MyCoroutine * this ) { return &this->__cor_d; }
    160160        //
    161161        class CoroutineKeyword final : public ConcurrentSueKeyword {
     
    163163
    164164                CoroutineKeyword() : ConcurrentSueKeyword(
    165                         "$coroutine",
     165                        "coroutine$",
    166166                        "__cor",
    167167                        "get_coroutine",
     
    190190        //      int data;                                  int data;
    191191        //      a_struct_t more_data;                      a_struct_t more_data;
    192         //                                =>             $monitor __mon_d;
     192        //                                =>             monitor$ __mon_d;
    193193        // };                                        };
    194         //                                           static inline $monitor * get_coroutine( MyMonitor * this ) { return &this->__cor_d; }
     194        //                                           static inline monitor$ * get_coroutine( MyMonitor * this ) { return &this->__cor_d; }
    195195        //
    196196        class MonitorKeyword final : public ConcurrentSueKeyword {
     
    198198
    199199                MonitorKeyword() : ConcurrentSueKeyword(
    200                         "$monitor",
     200                        "monitor$",
    201201                        "__mon",
    202202                        "get_monitor",
     
    230230
    231231                GeneratorKeyword() : ConcurrentSueKeyword(
    232                         "$generator",
     232                        "generator$",
    233233                        "__generator_state",
    234234                        "get_generator",
    235                         "Unable to find builtin type $generator\n",
     235                        "Unable to find builtin type generator$\n",
    236236                        "",
    237237                        true,
     
    292292        //Handles mutex routines definitions :
    293293        // 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) };
    295295        //                                                                       monitor_guard_t __guard = { __monitors, 2 };
    296296        //    /*Some code*/                                       =>           /*Some code*/
     
    333333        //Handles mutex routines definitions :
    334334        // 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) };
    336336        //                                                                       monitor_guard_t __guard = { __monitors, 2 };
    337337        //    /*Some code*/                                       =>           /*Some code*/
     
    449449        Expression * ConcurrentSueKeyword::postmutate( KeywordCastExpr * cast ) {
    450450                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.
    452452                        if( !type_decl ) SemanticError( cast, context_error );
    453453                        if( !dtor_decl ) SemanticError( cast, context_error );
     
    919919        void MutexKeyword::postvisit(StructDecl* decl) {
    920920
    921                 if( decl->name == "$monitor" && decl->body ) {
     921                if( decl->name == "monitor$" && decl->body ) {
    922922                        assert( !monitor_decl );
    923923                        monitor_decl = decl;
     
    10201020                );
    10211021
    1022                 //$monitor * __monitors[] = { get_monitor(a), get_monitor(b) };
     1022                //monitor$ * __monitors[] = { get_monitor(a), get_monitor(b) };
    10231023                body->push_front( new DeclStmt( monitors ) );
    10241024        }
     
    11171117                );
    11181118
    1119                 //$monitor * __monitors[] = { get_monitor(a), get_monitor(b) };
     1119                //monitor$ * __monitors[] = { get_monitor(a), get_monitor(b) };
    11201120                body->push_front( new DeclStmt( monitors) );
    11211121        }
     
    11251125        //=============================================================================================
    11261126        void ThreadStarter::previsit( StructDecl * decl ) {
    1127                 if( decl->name == "$thread" && decl->body ) {
     1127                if( decl->name == "thread$" && decl->body ) {
    11281128                        assert( !thread_decl );
    11291129                        thread_decl = decl;
Note: See TracChangeset for help on using the changeset viewer.