Changes in / [a14926b:a7662b8]
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/invoke.h
ra14926b ra7662b8 215 215 struct __thread_user_link cltr_link; 216 216 217 // used to store state between clh lock/unlock 218 volatile bool * clh_prev; 219 217 220 // used to point to this thd's current clh node 218 221 volatile bool * clh_node; -
libcfa/src/concurrency/locks.hfa
ra14926b ra7662b8 228 228 struct clh_lock { 229 229 volatile bool * volatile tail; 230 volatile bool * volatile head;231 230 }; 232 231 … … 238 237 *(curr_thd->clh_node) = false; 239 238 volatile bool * prev = __atomic_exchange_n((bool **)(&l.tail), (bool *)(curr_thd->clh_node), __ATOMIC_SEQ_CST); 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; 239 while(!__atomic_load_n(prev, __ATOMIC_ACQUIRE)) Pause(); 240 curr_thd->clh_prev = prev; 243 241 } 244 242 245 243 static inline void unlock(clh_lock & l) { 246 __atomic_store_n((bool *)(l.head), true, __ATOMIC_SEQ_CST); 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; 247 247 } 248 248 -
src/AST/Pass.hpp
ra14926b ra7662b8 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:: result::get( core, '0' ) ) {101 return __pass:: result::get( core, '0' );100 inline auto get_result() -> decltype( __pass::get_result( core, '0' ) ) { 101 return __pass::get_result( core, '0' ); 102 102 } 103 103 -
src/AST/Pass.proto.hpp
ra14926b ra7662b8 489 489 template<typename core_t> 490 490 static inline auto replace( core_t &, long, const ast::TypeInstType *& ) {} 491 491 492 } // namespace forall 492 493 … … 505 506 } 506 507 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 } 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 ) {} 522 520 } // namespace __pass 523 521 } // namespace ast -
src/GenPoly/Box.cc
ra14926b ra7662b8 424 424 namespace { 425 425 std::string makePolyMonoSuffix( FunctionType const * function, const TyVarMap &tyVars ) { 426 std::stringstream name; 427 426 428 // NOTE: this function previously used isPolyObj, which failed to produce 427 429 // the correct thing in some situations. It's not clear to me why this wasn't working. … … 430 432 // to take those polymorphic types as pointers. Therefore, there can be two different functions 431 433 // with the same mangled name, so we need to further mangle the names. 432 std::stringstream name;433 434 for ( DeclarationWithType const * const ret : function->returnVals ) { 434 name << ( isPolyType( ret->get_type(), tyVars ) ? 'P' : 'M' ); 435 } 436 name << '_'; 435 if ( isPolyType( ret->get_type(), tyVars ) ) { 436 name << "P"; 437 } else { 438 name << "M"; 439 } 440 } 441 name << "_"; 437 442 for ( DeclarationWithType const * const arg : function->parameters ) { 438 name << ( isPolyType( arg->get_type(), tyVars ) ? 'P' : 'M' ); 439 } 443 if ( isPolyType( arg->get_type(), tyVars ) ) { 444 name << "P"; 445 } else { 446 name << "M"; 447 } 448 } // for 440 449 return name.str(); 441 450 } … … 556 565 // even when converted to strings, sort in the original order. 557 566 // (At least, that is the best explination I have.) 558 for ( std::pair< conststd::string, TypeDecl::Data> const & tyParam : exprTyVars ) {567 for ( std::pair<std::string, TypeDecl::Data> const & tyParam : exprTyVars ) { 559 568 if ( !tyParam.second.isComplete ) continue; 560 569 Type *concrete = env->lookup( tyParam.first );
Note:
See TracChangeset
for help on using the changeset viewer.