Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/GenPoly.cc

    rc97b448 re9b5043  
    275275        }
    276276
    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 
    285277        bool needsAdapter( FunctionType *adaptee, const TyVarMap &tyVars ) {
    286278//              if ( ! adaptee->get_returnVals().empty() && isPolyType( adaptee->get_returnVals().front()->get_type(), tyVars ) ) {
     
    327319                return 0;
    328320        }
    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 }
    340321
    341322        Type * hasPolyBase( Type *type, int *levels, const TypeSubstitution *env ) {
     
    815796        }
    816797
    817 void addToTypeVarMap( const ast::TypeDecl * decl, TypeVarMap & typeVars ) {
    818         typeVars.insert( ast::TypeEnvKey( decl, 0, 0 ), ast::TypeData( decl ) );
    819 }
    820 
    821798void 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 ) );
    823800}
    824801
     
    845822}
    846823
    847 void makeTypeVarMap( const ast::FunctionDecl * decl, TypeVarMap & typeVars ) {
    848         for ( auto & typeDecl : decl->type_params ) {
    849                 addToTypeVarMap( typeDecl, typeVars );
    850         }
    851 }
    852 
    853824        void printTyVarMap( std::ostream &os, const TyVarMap &tyVarMap ) {
    854825                for ( TyVarMap::const_iterator i = tyVarMap.begin(); i != tyVarMap.end(); ++i ) {
Note: See TracChangeset for help on using the changeset viewer.