Ignore:
Timestamp:
Feb 22, 2019, 10:43:29 AM (5 years ago)
Author:
tdelisle <tdelisle@…>
Branches:
no_list
Parents:
43e0949
Message:

Parameters and return value of functions are now vectors (and some related clean-up)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/FindFunction.cc

    r43e0949 r2f42718  
    2929        class FindFunction : public WithGuards, public WithVisitorRef<FindFunction>, public WithShortCircuiting {
    3030          public:
    31                 FindFunction( std::list< FunctionType* > &functions, const TyVarMap &tyVars, bool replaceMode, FindFunctionPredicate predicate );
     31                FindFunction( std::vector< FunctionType* > & functions, const TyVarMap &tyVars, bool replaceMode, FindFunctionPredicate predicate );
    3232
    3333                void premutate( FunctionType * functionType );
     
    3737                void handleForall( const Type::ForallList &forall );
    3838
    39                 std::list< FunctionType* > &functions;
     39                std::vector< FunctionType* > &functions;
    4040                TyVarMap tyVars;
    4141                bool replaceMode;
     
    4343        };
    4444
    45         void findFunction( Type *type, std::list< FunctionType* > &functions, const TyVarMap &tyVars, FindFunctionPredicate predicate ) {
     45        void findFunction( Type *type, std::vector< FunctionType* > &functions, const TyVarMap &tyVars, FindFunctionPredicate predicate ) {
    4646                PassVisitor<FindFunction> finder( functions, tyVars, false, predicate );
    4747                type->acceptMutator( finder );
    4848        }
    4949
    50         void findAndReplaceFunction( Type *&type, std::list< FunctionType* > &functions, const TyVarMap &tyVars, FindFunctionPredicate predicate ) {
     50        void findAndReplaceFunction( Type *&type, std::vector< FunctionType* > &functions, const TyVarMap &tyVars, FindFunctionPredicate predicate ) {
    5151                PassVisitor<FindFunction> finder( functions, tyVars, true, predicate );
    5252                type = type->acceptMutator( finder );
    5353        }
    5454
    55         FindFunction::FindFunction( std::list< FunctionType* > &functions, const TyVarMap &tyVars, bool replaceMode, FindFunctionPredicate predicate )
     55        FindFunction::FindFunction( std::vector< FunctionType* > &functions, const TyVarMap &tyVars, bool replaceMode, FindFunctionPredicate predicate )
    5656                : functions( functions ), tyVars( tyVars ), replaceMode( replaceMode ), predicate( predicate ) {
    5757        }
     
    7070                GuardScope( tyVars );
    7171                handleForall( functionType->get_forall() );
    72                 mutateAll( functionType->get_returnVals(), *visitor );
     72                mutateAll( functionType->returnVals, *visitor );
    7373        }
    7474
Note: See TracChangeset for help on using the changeset viewer.