Changes in src/GenPoly/Box.cc [331ee52c:49db841]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r331ee52c r49db841 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.