Changeset a14926b


Ignore:
Timestamp:
Jan 5, 2023, 8:48:09 AM (16 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
3d4b7cc7
Parents:
a7662b8 (diff), d99a716 (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

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/invoke.h

    ra7662b8 ra14926b  
    215215                struct __thread_user_link cltr_link;
    216216
    217                 // used to store state between clh lock/unlock
    218                 volatile bool * clh_prev;
    219 
    220217                // used to point to this thd's current clh node
    221218                volatile bool * clh_node;
  • libcfa/src/concurrency/locks.hfa

    ra7662b8 ra14926b  
    228228struct clh_lock {
    229229        volatile bool * volatile tail;
     230    volatile bool * volatile head;
    230231};
    231232
     
    237238        *(curr_thd->clh_node) = false;
    238239        volatile bool * prev = __atomic_exchange_n((bool **)(&l.tail), (bool *)(curr_thd->clh_node), __ATOMIC_SEQ_CST);
    239         while(!__atomic_load_n(prev, __ATOMIC_ACQUIRE)) Pause();
    240         curr_thd->clh_prev = prev;
     240        while(!__atomic_load_n(prev, __ATOMIC_SEQ_CST)) Pause();
     241    __atomic_store_n((bool **)(&l.head), (bool *)curr_thd->clh_node, __ATOMIC_SEQ_CST);
     242    curr_thd->clh_node = prev;
    241243}
    242244
    243245static inline void unlock(clh_lock & l) {
    244         thread$ * curr_thd = active_thread();
    245         __atomic_store_n(curr_thd->clh_node, true, __ATOMIC_RELEASE);
    246         curr_thd->clh_node = curr_thd->clh_prev;
     246        __atomic_store_n((bool *)(l.head), true, __ATOMIC_SEQ_CST);
    247247}
    248248
  • src/AST/Pass.hpp

    ra7662b8 ra14926b  
    8686        {
    8787                // After the pass is constructed, check if it wants the have a pointer to the wrapping visitor
    88                 type * const * visitor = __pass::visitor(core, 0);
    89                 if(visitor) {
     88                type * const * visitor = __pass::visitor( core, 0 );
     89                if ( visitor ) {
    9090                        *const_cast<type **>( visitor ) = this;
    9191                }
     
    9898
    9999        /// If the core defines a result, call it if possible, otherwise return it.
    100         inline auto get_result() -> decltype( __pass::get_result( core, '0' ) ) {
    101                 return __pass::get_result( core, '0' );
     100        inline auto get_result() -> decltype( __pass::result::get( core, '0' ) ) {
     101                return __pass::result::get( core, '0' );
    102102        }
    103103
  • src/AST/Pass.proto.hpp

    ra7662b8 ra14926b  
    489489                template<typename core_t>
    490490                static inline auto replace( core_t &, long, const ast::TypeInstType *& ) {}
    491 
    492491        } // namespace forall
    493492
     
    506505        }
    507506
    508         template<typename core_t>
    509         static inline auto get_result( core_t & core, char ) -> decltype( core.result() ) {
    510                 return core.result();
    511         }
    512 
    513         template<typename core_t>
    514         static inline auto get_result( core_t & core, int ) -> decltype( core.result ) {
    515                 return core.result;
    516         }
    517 
    518         template<typename core_t>
    519         static inline void get_result( core_t &, long ) {}
     507        // For passes, usually utility passes, that have a result.
     508        namespace result {
     509                template<typename core_t>
     510                static inline auto get( core_t & core, char ) -> decltype( core.result() ) {
     511                        return core.result();
     512                }
     513
     514                template<typename core_t>
     515                static inline auto get( core_t & core, int ) -> decltype( core.result ) {
     516                        return core.result;
     517                }
     518
     519                template<typename core_t>
     520                static inline void get( core_t &, long ) {}
     521        }
    520522} // namespace __pass
    521523} // namespace ast
  • src/GenPoly/Box.cc

    ra7662b8 ra14926b  
    424424        namespace {
    425425                std::string makePolyMonoSuffix( FunctionType const * function, const TyVarMap &tyVars ) {
    426                         std::stringstream name;
    427 
    428426                        // NOTE: this function previously used isPolyObj, which failed to produce
    429427                        // the correct thing in some situations. It's not clear to me why this wasn't working.
     
    432430                        // to take those polymorphic types as pointers. Therefore, there can be two different functions
    433431                        // with the same mangled name, so we need to further mangle the names.
     432                        std::stringstream name;
    434433                        for ( DeclarationWithType const * const ret : function->returnVals ) {
    435                                 if ( isPolyType( ret->get_type(), tyVars ) ) {
    436                                         name << "P";
    437                                 } else {
    438                                         name << "M";
    439                                 }
    440                         }
    441                         name << "_";
     434                                name << ( isPolyType( ret->get_type(), tyVars ) ? 'P' : 'M' );
     435                        }
     436                        name << '_';
    442437                        for ( DeclarationWithType const * const arg : function->parameters ) {
    443                                 if ( isPolyType( arg->get_type(), tyVars ) ) {
    444                                         name << "P";
    445                                 } else {
    446                                         name << "M";
    447                                 }
    448                         } // for
     438                                name << ( isPolyType( arg->get_type(), tyVars ) ? 'P' : 'M' );
     439                        }
    449440                        return name.str();
    450441                }
     
    565556                        // even when converted to strings, sort in the original order.
    566557                        // (At least, that is the best explination I have.)
    567                         for ( std::pair<std::string, TypeDecl::Data> const & tyParam : exprTyVars ) {
     558                        for ( std::pair<const std::string, TypeDecl::Data> const & tyParam : exprTyVars ) {
    568559                                if ( !tyParam.second.isComplete ) continue;
    569560                                Type *concrete = env->lookup( tyParam.first );
Note: See TracChangeset for help on using the changeset viewer.