Changes in src/GenPoly/Box.cc [8ca3a72:7e003011]
- File:
-
- 1 edited
-
src/GenPoly/Box.cc (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r8ca3a72 r7e003011 62 62 namespace GenPoly { 63 63 namespace { 64 const std::list<Label> noLabels; 65 64 66 FunctionType *makeAdapterType( FunctionType *adaptee, const TyVarMap &tyVars ); 65 67 … … 101 103 void passTypeVars( ApplicationExpr *appExpr, Type *polyRetType, std::list< Expression *>::iterator &arg, const TyVarMap &exprTyVars ); 102 104 /// 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 );105 Expression *addRetParam( ApplicationExpr *appExpr, Type *retType, std::list< Expression *>::iterator &arg ); 104 106 /// Replaces all the type parameters of a generic type with their concrete equivalents under the current environment 105 107 void replaceParametersWithConcrete( ApplicationExpr *appExpr, std::list< Expression* >& params ); … … 134 136 public: 135 137 template< typename DeclClass > 136 DeclClass *handleDecl( DeclClass *decl , Type *type);138 DeclClass *handleDecl( DeclClass *decl ); 137 139 template< typename AggDecl > 138 140 AggDecl * handleAggDecl( AggDecl * aggDecl ); … … 663 665 } 664 666 665 Expression *Pass1::addRetParam( ApplicationExpr *appExpr, FunctionType *function,Type *retType, std::list< Expression *>::iterator &arg ) {667 Expression *Pass1::addRetParam( ApplicationExpr *appExpr, Type *retType, std::list< Expression *>::iterator &arg ) { 666 668 // Create temporary to hold return value of polymorphic function and produce that temporary as a result 667 669 // using a comma expression. … … 730 732 Type *concrete = replaceWithConcrete( appExpr, dynType ); 731 733 // add out-parameter for return value 732 return addRetParam( appExpr, function,concrete, arg );734 return addRetParam( appExpr, concrete, arg ); 733 735 } 734 736 … … 737 739 // if ( ! function->get_returnVals().empty() && isPolyType( function->get_returnVals().front()->get_type(), tyVars ) ) { 738 740 if ( isDynRet( function, tyVars ) ) { 739 ret = addRetParam( appExpr, function , function->get_returnVals().front()->get_type(), arg );741 ret = addRetParam( appExpr, function->get_returnVals().front()->get_type(), arg ); 740 742 } // if 741 743 std::string mangleName = mangleAdapterName( function, tyVars ); … … 1280 1282 1281 1283 template< typename DeclClass > 1282 DeclClass * Pass2::handleDecl( DeclClass *decl , Type *type) {1284 DeclClass * Pass2::handleDecl( DeclClass *decl ) { 1283 1285 DeclClass *ret = static_cast< DeclClass *>( Parent::mutate( decl ) ); 1284 1286 … … 1294 1296 1295 1297 DeclarationWithType * Pass2::mutate( FunctionDecl *functionDecl ) { 1296 functionDecl = safe_dynamic_cast< FunctionDecl * > ( handleDecl( functionDecl , functionDecl->get_functionType()) );1298 functionDecl = safe_dynamic_cast< FunctionDecl * > ( handleDecl( functionDecl ) ); 1297 1299 FunctionType * ftype = functionDecl->get_functionType(); 1298 1300 if ( ! ftype->get_returnVals().empty() && functionDecl->get_statements() ) { … … 1319 1321 1320 1322 ObjectDecl * Pass2::mutate( ObjectDecl *objectDecl ) { 1321 return handleDecl( objectDecl , objectDecl->get_type());1323 return handleDecl( objectDecl ); 1322 1324 } 1323 1325 … … 1342 1344 addToTyVarMap( typeDecl, scopeTyVars ); 1343 1345 if ( typeDecl->get_base() ) { 1344 return handleDecl( typeDecl , typeDecl->get_base());1346 return handleDecl( typeDecl ); 1345 1347 } else { 1346 1348 return Parent::mutate( typeDecl ); … … 1349 1351 1350 1352 TypedefDecl * Pass2::mutate( TypedefDecl *typedefDecl ) { 1351 return handleDecl( typedefDecl , typedefDecl->get_base());1353 return handleDecl( typedefDecl ); 1352 1354 } 1353 1355
Note:
See TracChangeset
for help on using the changeset viewer.