Changeset 10e90cb for src/GenPoly


Ignore:
Timestamp:
Jun 6, 2017, 2:50:57 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
c6d2e93
Parents:
8ca3a72 (diff), c5ac6d5 (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:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    r8ca3a72 r10e90cb  
    101101                        void passTypeVars( ApplicationExpr *appExpr, Type *polyRetType, std::list< Expression *>::iterator &arg, const TyVarMap &exprTyVars );
    102102                        /// wraps a function application with a new temporary for the out-parameter return value
    103                         Expression *addRetParam( ApplicationExpr *appExpr, FunctionType *function, Type *retType, std::list< Expression *>::iterator &arg );
     103                        Expression *addRetParam( ApplicationExpr *appExpr, Type *retType, std::list< Expression *>::iterator &arg );
    104104                        /// Replaces all the type parameters of a generic type with their concrete equivalents under the current environment
    105105                        void replaceParametersWithConcrete( ApplicationExpr *appExpr, std::list< Expression* >& params );
     
    134134                  public:
    135135                        template< typename DeclClass >
    136                         DeclClass *handleDecl( DeclClass *decl, Type *type );
     136                        DeclClass *handleDecl( DeclClass *decl );
    137137                        template< typename AggDecl >
    138138                        AggDecl * handleAggDecl( AggDecl * aggDecl );
     
    663663                }
    664664
    665                 Expression *Pass1::addRetParam( ApplicationExpr *appExpr, FunctionType *function, Type *retType, std::list< Expression *>::iterator &arg ) {
     665                Expression *Pass1::addRetParam( ApplicationExpr *appExpr, Type *retType, std::list< Expression *>::iterator &arg ) {
    666666                        // Create temporary to hold return value of polymorphic function and produce that temporary as a result
    667667                        // using a comma expression.
     
    730730                        Type *concrete = replaceWithConcrete( appExpr, dynType );
    731731                        // add out-parameter for return value
    732                         return addRetParam( appExpr, function, concrete, arg );
     732                        return addRetParam( appExpr, concrete, arg );
    733733                }
    734734
     
    737737//                      if ( ! function->get_returnVals().empty() && isPolyType( function->get_returnVals().front()->get_type(), tyVars ) ) {
    738738                        if ( isDynRet( function, tyVars ) ) {
    739                                 ret = addRetParam( appExpr, function, function->get_returnVals().front()->get_type(), arg );
     739                                ret = addRetParam( appExpr, function->get_returnVals().front()->get_type(), arg );
    740740                        } // if
    741741                        std::string mangleName = mangleAdapterName( function, tyVars );
     
    12801280
    12811281                template< typename DeclClass >
    1282                 DeclClass * Pass2::handleDecl( DeclClass *decl, Type *type ) {
     1282                DeclClass * Pass2::handleDecl( DeclClass *decl ) {
    12831283                        DeclClass *ret = static_cast< DeclClass *>( Parent::mutate( decl ) );
    12841284
     
    12941294
    12951295                DeclarationWithType * Pass2::mutate( FunctionDecl *functionDecl ) {
    1296                         functionDecl = safe_dynamic_cast< FunctionDecl * > ( handleDecl( functionDecl, functionDecl->get_functionType() ) );
     1296                        functionDecl = safe_dynamic_cast< FunctionDecl * > ( handleDecl( functionDecl ) );
    12971297                        FunctionType * ftype = functionDecl->get_functionType();
    12981298                        if ( ! ftype->get_returnVals().empty() && functionDecl->get_statements() ) {
     
    13191319
    13201320                ObjectDecl * Pass2::mutate( ObjectDecl *objectDecl ) {
    1321                         return handleDecl( objectDecl, objectDecl->get_type() );
     1321                        return handleDecl( objectDecl );
    13221322                }
    13231323
     
    13421342                        addToTyVarMap( typeDecl, scopeTyVars );
    13431343                        if ( typeDecl->get_base() ) {
    1344                                 return handleDecl( typeDecl, typeDecl->get_base() );
     1344                                return handleDecl( typeDecl );
    13451345                        } else {
    13461346                                return Parent::mutate( typeDecl );
     
    13491349
    13501350                TypedefDecl * Pass2::mutate( TypedefDecl *typedefDecl ) {
    1351                         return handleDecl( typedefDecl, typedefDecl->get_base() );
     1351                        return handleDecl( typedefDecl );
    13521352                }
    13531353
Note: See TracChangeset for help on using the changeset viewer.