Changes in / [4df85197:3d1e617]


Ignore:
Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/GenPoly.cc

    r4df85197 r3d1e617  
    6464                        return false;
    6565                }
    66 
     66               
    6767                /// Replaces a TypeInstType by its referrent in the environment, if applicable
    6868                Type* replaceTypeInst( Type* type, const TypeSubstitution* env ) {
     
    7878        Type *isPolyType( Type *type, const TypeSubstitution *env ) {
    7979                type = replaceTypeInst( type, env );
    80 
     80               
    8181                if ( TypeInstType *typeInst = dynamic_cast< TypeInstType * >( type ) ) {
    8282                        return type;
     
    9191        Type *isPolyType( Type *type, const TyVarMap &tyVars, const TypeSubstitution *env ) {
    9292                type = replaceTypeInst( type, env );
    93 
     93               
    9494                if ( TypeInstType *typeInst = dynamic_cast< TypeInstType * >( type ) ) {
    9595                        if ( tyVars.find( typeInst->get_name() ) != tyVars.end() ) {
     
    106106        Type *isPolyPtr( Type *type, const TypeSubstitution *env ) {
    107107                type = replaceTypeInst( type, env );
    108 
     108               
    109109                if ( PointerType *ptr = dynamic_cast< PointerType *>( type ) ) {
    110110                        return isPolyType( ptr->get_base(), env );
     
    115115        Type *isPolyPtr( Type *type, const TyVarMap &tyVars, const TypeSubstitution *env ) {
    116116                type = replaceTypeInst( type, env );
    117 
     117               
    118118                if ( PointerType *ptr = dynamic_cast< PointerType *>( type ) ) {
    119119                        return isPolyType( ptr->get_base(), tyVars, env );
     
    129129                while ( true ) {
    130130                        type = replaceTypeInst( type, env );
    131 
     131               
    132132                        if ( PointerType *ptr = dynamic_cast< PointerType *>( type ) ) {
    133133                                type = ptr->get_base();
     
    146146                while ( true ) {
    147147                        type = replaceTypeInst( type, env );
    148 
     148               
    149149                        if ( PointerType *ptr = dynamic_cast< PointerType *>( type ) ) {
    150150                                type = ptr->get_base();
  • src/SymTab/Validate.cc

    r4df85197 r3d1e617  
    291291
    292292        namespace {
    293                 template< typename DWTList >
    294                 void fixFunctionList( DWTList & dwts, FunctionType * func ) {
     293                template< typename DWTIterator >
     294                void fixFunctionList( DWTIterator begin, DWTIterator end, FunctionType *func ) {
    295295                        // the only case in which "void" is valid is where it is the only one in the list; then it should be removed
    296296                        // entirely other fix ups are handled by the FixFunction class
    297                         typedef typename DWTList::iterator DWTIterator;
    298                         DWTIterator begin( dwts.begin() ), end( dwts.end() );
    299297                        if ( begin == end ) return;
    300298                        FixFunction fixer;
    301299                        DWTIterator i = begin;
    302                         *i = (*i)->acceptMutator( fixer );
     300                        *i = (*i )->acceptMutator( fixer );
    303301                        if ( fixer.get_isVoid() ) {
    304302                                DWTIterator j = i;
    305303                                ++i;
    306                                 dwts.erase( j );
     304                                func->get_parameters().erase( j );
    307305                                if ( i != end ) {
    308306                                        throw SemanticError( "invalid type void in function type ", func );
     
    323321        void Pass1::visit( FunctionType *func ) {
    324322                // Fix up parameters and return types
    325                 fixFunctionList( func->get_parameters(), func );
    326                 fixFunctionList( func->get_returnVals(), func );
     323                fixFunctionList( func->get_parameters().begin(), func->get_parameters().end(), func );
     324                fixFunctionList( func->get_returnVals().begin(), func->get_returnVals().end(), func );
    327325                Visitor::visit( func );
    328326        }
Note: See TracChangeset for help on using the changeset viewer.