Changeset 33a7b6d for src/GenPoly/Box.cc


Ignore:
Timestamp:
Nov 15, 2016, 5:30:52 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:
d9fa60a
Parents:
8f9cc50
Message:

changed use of formal types to actual types for boxing return parameters and passing type variables, fix bug where generic struct's members would change types when a member is accessed on a concrete instantiation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    r8f9cc50 r33a7b6d  
    12881288                        TyVarMap exprTyVars( (TypeDecl::Kind)-1 );
    12891289                        makeTyVarMap( function, exprTyVars );
     1290                        ReferenceToType *concRetType = dynamic_cast< ReferenceToType* >( appExpr->get_result() ); // xxx - is concRetType a good name?
    12901291                        ReferenceToType *dynRetType = isDynRet( function, exprTyVars );
    12911292
    12921293                        if ( dynRetType ) {
    1293                                 ret = addDynRetParam( appExpr, function, dynRetType, arg );
     1294                                ret = addDynRetParam( appExpr, function, concRetType, arg ); // xxx - used to use dynRetType instead of concRetType
    12941295                        } else if ( needsAdapter( function, scopeTyVars ) ) {
    12951296                                // std::cerr << "needs adapter: ";
     
    13011302                        arg = appExpr->get_args().begin();
    13021303
    1303                         passTypeVars( appExpr, dynRetType, arg, exprTyVars );
     1304                        passTypeVars( appExpr, concRetType, arg, exprTyVars ); // xxx - used to use dynRetType instead of concRetType
    13041305                        addInferredParams( appExpr, function, arg, exprTyVars );
    13051306
     
    13641365                        // line below cloned from FixFunction.cc
    13651366                        // xxx - functionObj is never added to a list of declarations...
     1367                        // alternatively, this function could return a new VariableExpr( functionDecl ) and change the result type of the new expression
    13661368                        ObjectDecl *functionObj = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClass(), functionDecl->get_linkage(), 0,
    13671369                                                                  new PointerType( Type::Qualifiers(), functionDecl->get_type()->clone() ), 0 );
Note: See TracChangeset for help on using the changeset viewer.