Changeset c86ee4c for src


Ignore:
Timestamp:
Jul 7, 2021, 6:24:42 PM (4 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:
d83b266
Parents:
1f45c7d (diff), b1a2c4a (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    r1f45c7d rc86ee4c  
    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;
  • src/Concurrency/Waitfor.cc

    r1f45c7d rc86ee4c  
    244244                        decl_mask = decl;
    245245                }
    246                 else if( decl->name == "$monitor" ) {
     246                else if( decl->name == "monitor$" ) {
    247247                        assert( !decl_monitor );
    248248                        decl_monitor = decl;
  • src/ResolvExpr/AlternativeFinder.cc

    r1f45c7d rc86ee4c  
    13021302
    13031303                try {
    1304                         // Attempt 1 : turn (thread&)X into ($thread&)X.__thrd
     1304                        // Attempt 1 : turn (thread&)X into (thread$&)X.__thrd
    13051305                        // Clone is purely for memory management
    13061306                        std::unique_ptr<Expression> tech1 { new UntypedMemberExpr(new NameExpr(castExpr->concrete_target.field), castExpr->arg->clone()) };
     
    13131313                } catch(SemanticErrorException & ) {}
    13141314
    1315                 // Fallback : turn (thread&)X into ($thread&)get_thread(X)
     1315                // Fallback : turn (thread&)X into (thread$&)get_thread(X)
    13161316                std::unique_ptr<Expression> fallback { UntypedExpr::createDeref( new UntypedExpr(new NameExpr(castExpr->concrete_target.getter), { castExpr->arg->clone() })) };
    13171317                // don't prune here, since it's guaranteed all alternatives will have the same type
  • src/ResolvExpr/CandidateFinder.cpp

    r1f45c7d rc86ee4c  
    11801180
    11811181                        try {
    1182                                 // Attempt 1 : turn (thread&)X into ($thread&)X.__thrd
     1182                                // Attempt 1 : turn (thread&)X into (thread$&)X.__thrd
    11831183                                // Clone is purely for memory management
    11841184                                std::unique_ptr<const ast::Expr> tech1 { new ast::UntypedMemberExpr(loc, new ast::NameExpr(loc, castExpr->concrete_target.field), castExpr->arg) };
     
    11911191                        } catch(SemanticErrorException & ) {}
    11921192
    1193                         // Fallback : turn (thread&)X into ($thread&)get_thread(X)
     1193                        // Fallback : turn (thread&)X into (thread$&)get_thread(X)
    11941194                        std::unique_ptr<const ast::Expr> fallback { ast::UntypedExpr::createDeref(loc,  new ast::UntypedExpr(loc, new ast::NameExpr(loc, castExpr->concrete_target.getter), { castExpr->arg })) };
    11951195                        // don't prune here, since it's guaranteed all alternatives will have the same type
Note: See TracChangeset for help on using the changeset viewer.