- Timestamp:
- Nov 8, 2017, 3:37:29 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 78315272
- Parents:
- 76a395a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.cc
r76a395a rfae6f21 632 632 std::vector<ArgPack> finalResults{}; /// list of completed tuples 633 633 // start tuples 634 for ( ArgPack& result : results ) { result.beginTuple(); } 634 for ( ArgPack& result : results ) { 635 result.beginTuple(); 636 637 // use rest of exploded tuple if present 638 while ( result.nextExpl < result.expls.size() ) { 639 const Alternative& actual = result.expls[result.nextExpl]; 640 result.env.addActual( actual.env, result.openVars ); 641 result.withArg( actual.expr ); 642 ++result.nextExpl; 643 } 644 } 635 645 // iterate until all results completed 636 646 while ( ! results.empty() ) { … … 760 770 // add argument 761 771 aResult.withArg( aActual.expr, actual.cost ); 762 if ( exploded.size() == 1 ) { 763 // argument consumed 764 ++aResult.nextArg; 765 } else { 772 ++aResult.nextArg; 773 if ( exploded.size() > 1 ) { 766 774 // other parts of tuple left over 767 775 aResult.expls = std::move( exploded ); … … 815 823 std::vector<ArgPack> finalResults{}; 816 824 if ( funcType->get_isVarArgs() ) { 825 for ( ArgPack& result : results ) { 826 // use rest of exploded tuple if present 827 while ( result.nextExpl < result.expls.size() ) { 828 const Alternative& actual = result.expls[result.nextExpl]; 829 result.env.addActual( actual.env, result.openVars ); 830 result.withArg( actual.expr ); 831 ++result.nextExpl; 832 } 833 } 834 817 835 while ( ! results.empty() ) { 818 836 // build combinations for all remaining arguments … … 852 870 // filter out results that don't use all the arguments 853 871 for ( ArgPack& result : results ) { 854 if ( result.next Arg >= args.size() ) {872 if ( result.nextExpl >= result.expls.size() && result.nextArg >= args.size() ) { 855 873 finalResults.push_back( std::move(result) ); 856 874 }
Note: See TracChangeset
for help on using the changeset viewer.