Changes in src/GenPoly/GenPoly.cc [c97b448:e9b5043]
- File:
-
- 1 edited
-
src/GenPoly/GenPoly.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/GenPoly.cc
rc97b448 re9b5043 275 275 } 276 276 277 const ast::BaseInstType *isDynRet( const ast::FunctionType * func ) {278 if ( func->returns.empty() ) return nullptr;279 280 TypeVarMap forallTypes = { ast::TypeData() };281 makeTypeVarMap( func, forallTypes );282 return isDynType( func->returns.front(), forallTypes );283 }284 285 277 bool needsAdapter( FunctionType *adaptee, const TyVarMap &tyVars ) { 286 278 // if ( ! adaptee->get_returnVals().empty() && isPolyType( adaptee->get_returnVals().front()->get_type(), tyVars ) ) { … … 327 319 return 0; 328 320 } 329 330 const ast::Type * isPolyPtr(331 const ast::Type * type, const TypeVarMap & typeVars,332 const ast::TypeSubstitution * typeSubs ) {333 type = replaceTypeInst( type, typeSubs );334 335 if ( auto * ptr = dynamic_cast<ast::PointerType const *>( type ) ) {336 return isPolyType( ptr->base, typeVars, typeSubs );337 }338 return nullptr;339 }340 321 341 322 Type * hasPolyBase( Type *type, int *levels, const TypeSubstitution *env ) { … … 815 796 } 816 797 817 void addToTypeVarMap( const ast::TypeDecl * decl, TypeVarMap & typeVars ) {818 typeVars.insert( ast::TypeEnvKey( decl, 0, 0 ), ast::TypeData( decl ) );819 }820 821 798 void addToTypeVarMap( const ast::TypeInstType * type, TypeVarMap & typeVars ) { 822 typeVars.insert( ast::TypeEnvKey( *type ), ast::TypeData( type->base ) );799 typeVars.insert( *type, ast::TypeData( type->base ) ); 823 800 } 824 801 … … 845 822 } 846 823 847 void makeTypeVarMap( const ast::FunctionDecl * decl, TypeVarMap & typeVars ) {848 for ( auto & typeDecl : decl->type_params ) {849 addToTypeVarMap( typeDecl, typeVars );850 }851 }852 853 824 void printTyVarMap( std::ostream &os, const TyVarMap &tyVarMap ) { 854 825 for ( TyVarMap::const_iterator i = tyVarMap.begin(); i != tyVarMap.end(); ++i ) {
Note:
See TracChangeset
for help on using the changeset viewer.