Changeset a14926b
- Timestamp:
- Jan 5, 2023, 8:48:09 AM (5 months ago)
- Branches:
- ADT, 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. - Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/invoke.h
ra7662b8 ra14926b 215 215 struct __thread_user_link cltr_link; 216 216 217 // used to store state between clh lock/unlock218 volatile bool * clh_prev;219 220 217 // used to point to this thd's current clh node 221 218 volatile bool * clh_node; -
libcfa/src/concurrency/locks.hfa
ra7662b8 ra14926b 228 228 struct clh_lock { 229 229 volatile bool * volatile tail; 230 volatile bool * volatile head; 230 231 }; 231 232 … … 237 238 *(curr_thd->clh_node) = false; 238 239 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; 241 243 } 242 244 243 245 static 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); 247 247 } 248 248 -
src/AST/Pass.hpp
ra7662b8 ra14926b 86 86 { 87 87 // 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 ) { 90 90 *const_cast<type **>( visitor ) = this; 91 91 } … … 98 98 99 99 /// 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' ); 102 102 } 103 103 -
src/AST/Pass.proto.hpp
ra7662b8 ra14926b 489 489 template<typename core_t> 490 490 static inline auto replace( core_t &, long, const ast::TypeInstType *& ) {} 491 492 491 } // namespace forall 493 492 … … 506 505 } 507 506 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 } 520 522 } // namespace __pass 521 523 } // namespace ast -
src/GenPoly/Box.cc
ra7662b8 ra14926b 424 424 namespace { 425 425 std::string makePolyMonoSuffix( FunctionType const * function, const TyVarMap &tyVars ) { 426 std::stringstream name;427 428 426 // NOTE: this function previously used isPolyObj, which failed to produce 429 427 // the correct thing in some situations. It's not clear to me why this wasn't working. … … 432 430 // to take those polymorphic types as pointers. Therefore, there can be two different functions 433 431 // with the same mangled name, so we need to further mangle the names. 432 std::stringstream name; 434 433 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 << '_'; 442 437 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 } 449 440 return name.str(); 450 441 } … … 565 556 // even when converted to strings, sort in the original order. 566 557 // (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 ) { 568 559 if ( !tyParam.second.isComplete ) continue; 569 560 Type *concrete = env->lookup( tyParam.first );
Note: See TracChangeset
for help on using the changeset viewer.