Changeset ef9988b for src/ResolvExpr
- Timestamp:
- Aug 18, 2020, 4:26:19 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 13d33a75
- Parents:
- 4fe6224
- Location:
- src/ResolvExpr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CandidateFinder.cpp
r4fe6224 ref9988b 1473 1473 // unification run for side-effects 1474 1474 unify( toType, cand->expr->result, env, need, have, open, symtab ); 1475 Cost thisCost = c astCost( cand->expr->result, toType, cand->expr->get_lvalue(),1475 Cost thisCost = computeConversionCost( cand->expr->result, toType, cand->expr->get_lvalue(), 1476 1476 symtab, env ); 1477 1477 … … 1483 1483 initExpr->location, restructureCast( cand->expr, toType ), 1484 1484 initAlt.designation }, 1485 copy( cand->env), move( open ), move( need ), cand->cost, thisCost );1485 move(env), move( open ), move( need ), cand->cost, thisCost ); 1486 1486 inferParameters( newCand, matches ); 1487 1487 } -
src/ResolvExpr/Unify.cc
r4fe6224 ref9988b 791 791 for ( const ast::DeclWithType * d : src ) { 792 792 ast::Pass<TtypeExpander_new> expander{ env }; 793 d = d->accept( expander ); 794 auto types = flatten( d->get_type() ); 793 // TtypeExpander pass is impure (may mutate nodes in place) 794 // need to make nodes shared to prevent accidental mutation 795 ast::ptr<ast::DeclWithType> dc = d; 796 dc = dc->accept( expander ); 797 auto types = flatten( dc->get_type() ); 795 798 for ( ast::ptr< ast::Type > & t : types ) { 796 799 // outermost const, volatile, _Atomic qualifiers in parameters should not play … … 801 804 // requirements than a non-mutex function 802 805 remove_qualifiers( t, ast::CV::Const | ast::CV::Volatile | ast::CV::Atomic ); 803 dst.emplace_back( new ast::ObjectDecl{ d ->location, "", t } );806 dst.emplace_back( new ast::ObjectDecl{ dc->location, "", t } ); 804 807 } 805 808 } … … 1110 1113 1111 1114 ast::Pass<TtypeExpander_new> expander{ tenv }; 1112 const ast::Type * flat = tuple->accept( expander ); 1113 const ast::Type * flat2 = tuple2->accept( expander ); 1115 1116 ast::ptr<ast::TupleType> tuplec = tuple; 1117 ast::ptr<ast::TupleType> tuple2c = tuple2; 1118 const ast::Type * flat = tuplec->accept( expander ); 1119 const ast::Type * flat2 = tuple2c->accept( expander ); 1114 1120 1115 1121 auto types = flatten( flat );
Note: See TracChangeset
for help on using the changeset viewer.