Changeset aadb0c8


Ignore:
Timestamp:
Dec 3, 2022, 5:57:04 PM (2 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
4020f09
Parents:
8a3d5e7 (diff), 474a170 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    r8a3d5e7 raadb0c8  
    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.