Changeset 474a170


Ignore:
Timestamp:
Dec 2, 2022, 9:53:16 AM (16 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
aadb0c8
Parents:
a84f643
Message:

Cleaning old box pass for easier translation. Removing another out parameter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    ra84f643 r474a170  
    9595                        /// Pass the extra type parameters from polymorphic generic arguments or return types into a function application
    9696                        /// Will insert 0, 2 or 3 more arguments.
    97                         void passArgTypeVars( ApplicationExpr *appExpr, Type *parmType, Type *argBaseType, std::list< Expression *>::iterator &arg, const TyVarMap &exprTyVars, std::set< std::string > &seenTypes );
     97                        std::list< Expression *>::iterator passArgTypeVars( ApplicationExpr *appExpr, Type *parmType, Type *argBaseType, std::list< Expression *>::iterator arg, const TyVarMap &exprTyVars, std::set< std::string > &seenTypes );
    9898                        /// passes extra type parameters into a polymorphic function application
    9999                        /// Returns an iterator to the first argument after the added
     
    531531                }
    532532
    533                 void Pass1::passArgTypeVars( ApplicationExpr *appExpr, Type *parmType, Type *argBaseType, std::list< Expression *>::iterator &arg, const TyVarMap &exprTyVars, std::set< std::string > &seenTypes ) {
     533                std::list< Expression *>::iterator Pass1::passArgTypeVars( ApplicationExpr *appExpr, Type *parmType, Type *argBaseType, std::list< Expression *>::iterator arg, const TyVarMap &exprTyVars, std::set< std::string > &seenTypes ) {
    534534                        Type *polyType = isPolyType( parmType, exprTyVars );
    535535                        if ( polyType && ! dynamic_cast< TypeInstType* >( polyType ) ) {
    536536                                std::string typeName = mangleType( polyType );
    537                                 if ( seenTypes.count( typeName ) ) return;
     537                                if ( seenTypes.count( typeName ) ) return arg;
    538538
    539539                                arg = appExpr->get_args().insert( arg, new SizeofExpr( argBaseType->clone() ) );
     
    555555                                seenTypes.insert( typeName );
    556556                        }
     557                        return arg;
    557558                }
    558559
     
    593594                        if ( polyRetType ) {
    594595                                Type *concRetType = replaceWithConcrete( polyRetType, env );
    595                                 passArgTypeVars( appExpr, polyRetType, concRetType, arg, exprTyVars, seenTypes );
     596                                arg = passArgTypeVars( appExpr, polyRetType, concRetType, arg, exprTyVars, seenTypes );
    596597                                // Skip the return parameter in the argument list.
    597598                                fnArg = arg + 1;
     
    605606                                Type * argType = (*fnArg)->get_result();
    606607                                if ( ! argType ) continue;
    607                                 passArgTypeVars( appExpr, (*fnParm)->get_type(), argType, arg, exprTyVars, seenTypes );
     608                                arg = passArgTypeVars( appExpr, (*fnParm)->get_type(), argType, arg, exprTyVars, seenTypes );
    608609                        }
    609610                        return arg;
Note: See TracChangeset for help on using the changeset viewer.