Ignore:
Timestamp:
Feb 24, 2020, 2:21:03 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
959f6ad
Parents:
0f2c555
Message:

Changed descriptors for concurrency to use $ prefix instead of trailing _desc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    r0f2c555 rac2b598  
    8888        //      int data;                                  int data;
    8989        //      a_struct_t more_data;                      a_struct_t more_data;
    90         //                                =>             thread_desc __thrd_d;
     90        //                                =>             $thread __thrd_d;
    9191        // };                                        };
    92         //                                           static inline thread_desc * get_thread( MyThread * this ) { return &this->__thrd_d; }
     92        //                                           static inline $thread * get_thread( MyThread * this ) { return &this->__thrd_d; }
    9393        //
    9494        class ThreadKeyword final : public ConcurrentSueKeyword {
     
    9696
    9797                ThreadKeyword() : ConcurrentSueKeyword(
    98                         "thread_desc",
     98                        "$thread",
    9999                        "__thrd",
    100100                        "get_thread",
     
    120120        //      int data;                                  int data;
    121121        //      a_struct_t more_data;                      a_struct_t more_data;
    122         //                                =>             coroutine_desc __cor_d;
     122        //                                =>             $coroutine __cor_d;
    123123        // };                                        };
    124         //                                           static inline coroutine_desc * get_coroutine( MyCoroutine * this ) { return &this->__cor_d; }
     124        //                                           static inline $coroutine * get_coroutine( MyCoroutine * this ) { return &this->__cor_d; }
    125125        //
    126126        class CoroutineKeyword final : public ConcurrentSueKeyword {
     
    128128
    129129                CoroutineKeyword() : ConcurrentSueKeyword(
    130                         "coroutine_desc",
     130                        "$coroutine",
    131131                        "__cor",
    132132                        "get_coroutine",
     
    152152        //      int data;                                  int data;
    153153        //      a_struct_t more_data;                      a_struct_t more_data;
    154         //                                =>             monitor_desc __mon_d;
     154        //                                =>             $monitor __mon_d;
    155155        // };                                        };
    156         //                                           static inline monitor_desc * get_coroutine( MyMonitor * this ) { return &this->__cor_d; }
     156        //                                           static inline $monitor * get_coroutine( MyMonitor * this ) { return &this->__cor_d; }
    157157        //
    158158        class MonitorKeyword final : public ConcurrentSueKeyword {
     
    160160
    161161                MonitorKeyword() : ConcurrentSueKeyword(
    162                         "monitor_desc",
     162                        "$monitor",
    163163                        "__mon",
    164164                        "get_monitor",
     
    182182        //Handles mutex routines definitions :
    183183        // void foo( A * mutex a, B * mutex b,  int i ) {                  void foo( A * a, B * b,  int i ) {
    184         //                                                                       monitor_desc * __monitors[] = { get_monitor(a), get_monitor(b) };
     184        //                                                                       $monitor * __monitors[] = { get_monitor(a), get_monitor(b) };
    185185        //                                                                       monitor_guard_t __guard = { __monitors, 2 };
    186186        //    /*Some code*/                                       =>           /*Some code*/
     
    221221        //Handles mutex routines definitions :
    222222        // void foo( A * mutex a, B * mutex b,  int i ) {                  void foo( A * a, B * b,  int i ) {
    223         //                                                                       monitor_desc * __monitors[] = { get_monitor(a), get_monitor(b) };
     223        //                                                                       $monitor * __monitors[] = { get_monitor(a), get_monitor(b) };
    224224        //                                                                       monitor_guard_t __guard = { __monitors, 2 };
    225225        //    /*Some code*/                                       =>           /*Some code*/
     
    306306        Expression * ConcurrentSueKeyword::postmutate( KeywordCastExpr * cast ) {
    307307                if ( cast_target == cast->target ) {
    308                         // convert (thread &)t to (thread_desc &)*get_thread(t), etc.
     308                        // convert (thread &)t to ($thread &)*get_thread(t), etc.
    309309                        if( !type_decl ) SemanticError( cast, context_error );
    310310                        if( !dtor_decl ) SemanticError( cast, context_error );
     
    516516        void MutexKeyword::postvisit(StructDecl* decl) {
    517517
    518                 if( decl->name == "monitor_desc" && decl->body ) {
     518                if( decl->name == "$monitor" && decl->body ) {
    519519                        assert( !monitor_decl );
    520520                        monitor_decl = decl;
     
    612612                );
    613613
    614                 //monitor_desc * __monitors[] = { get_monitor(a), get_monitor(b) };
     614                //$monitor * __monitors[] = { get_monitor(a), get_monitor(b) };
    615615                body->push_front( new DeclStmt( monitors) );
    616616        }
     
    673673                );
    674674
    675                 //monitor_desc * __monitors[] = { get_monitor(a), get_monitor(b) };
     675                //$monitor * __monitors[] = { get_monitor(a), get_monitor(b) };
    676676                body->push_front( new DeclStmt( monitors) );
    677677        }
     
    681681        //=============================================================================================
    682682        void ThreadStarter::previsit( StructDecl * decl ) {
    683                 if( decl->name == "thread_desc" && decl->body ) {
     683                if( decl->name == "$thread" && decl->body ) {
    684684                        assert( !thread_decl );
    685685                        thread_decl = decl;
Note: See TracChangeset for help on using the changeset viewer.