Changeset e172f42 for src/Validate/Autogen.cpp
- Timestamp:
- Jun 16, 2023, 9:10:46 AM (19 months ago)
- Branches:
- master
- Children:
- 5dbb9f3
- Parents:
- a0bd9a2 (diff), 62d62db (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Validate/Autogen.cpp
ra0bd9a2 re172f42 321 321 void FuncGenerator::produceDecl( const ast::FunctionDecl * decl ) { 322 322 assert( nullptr != decl->stmts ); 323 const auto & oldParams = getGenericParams(type); 324 assert( decl->type_params.size() == oldParams.size()); 325 326 /* 327 ast::DeclReplacer::TypeMap typeMap; 328 for (auto it = oldParams.begin(), jt = decl->type_params.begin(); it != oldParams.end(); ++it, ++jt) { 329 typeMap.emplace(*it, *jt); 330 } 331 332 const ast::FunctionDecl * mut = strict_dynamic_cast<const ast::FunctionDecl *>(ast::DeclReplacer::replace(decl, typeMap)); 333 assert (mut == decl); 334 */ 323 335 324 336 definitions.push_back( decl ); … … 352 364 std::vector<ast::ptr<ast::TypeDecl>> type_params; 353 365 std::vector<ast::ptr<ast::DeclWithType>> assertions; 366 367 ast::DeclReplacer::TypeMap typeMap; 354 368 for ( auto & old_param : old_type_params ) { 355 369 ast::TypeDecl * decl = ast::deepCopy( old_param ); … … 358 372 oldToNew.emplace( std::make_pair( old_param, decl ) ); 359 373 type_params.push_back( decl ); 374 typeMap.emplace(old_param, decl); 375 } 376 377 for (auto & param : params) { 378 param = ast::DeclReplacer::replace(param, typeMap); 379 } 380 for (auto & param : returns) { 381 param = ast::DeclReplacer::replace(param, typeMap); 360 382 } 361 383 replaceAll( params, oldToNew ); … … 522 544 InitTweak::InitExpander_new srcParam( src ); 523 545 // Assign to destination. 524 ast:: Expr * dstSelect = new ast::MemberExpr(546 ast::MemberExpr * dstSelect = new ast::MemberExpr( 525 547 location, 526 548 field, … … 574 596 } 575 597 576 ast:: Expr * srcSelect = (srcParam) ? new ast::MemberExpr(598 ast::MemberExpr * srcSelect = (srcParam) ? new ast::MemberExpr( 577 599 location, field, new ast::VariableExpr( location, srcParam ) 578 600 ) : nullptr;
Note: See TracChangeset
for help on using the changeset viewer.