Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/InstantiateGeneric.cc

    rf18a711 re491159  
    2323#include "DeclMutator.h"
    2424#include "GenPoly.h"
    25 #include "ScopedMap.h"
    2625#include "ScopedSet.h"
    2726
     
    3231#include "SynTree/Type.h"
    3332
     33#include "Common/ScopedMap.h"
    3434#include "Common/UniqueName.h"
    3535#include "Common/utility.h"
     
    8484                std::list< Type* > params;  ///< Instantiation parameters
    8585        };
    86        
     86
    8787        /// Maps a key and a TypeList to the some value, accounting for scope
    8888        template< typename Key, typename Value >
     
    145145                return gt;
    146146        }
    147        
     147
    148148        /// Mutator pass that replaces concrete instantiations of generic types with actual struct declarations, scoped appropriately
    149149        class GenericInstantiator : public DeclMutator {
     
    193193                        TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param );
    194194                        assert(paramType && "Aggregate parameters should be type expressions");
    195                        
     195
    196196                        switch ( (*baseParam)->get_kind() ) {
    197197                        case TypeDecl::Any: {
     
    242242                inst->get_parameters().clear();
    243243        }
    244        
     244
    245245        void GenericInstantiator::stripDtypeParams( AggregateDecl *base, std::list< TypeDecl* >& baseParams, const std::list< TypeExpr* >& typeSubs ) {
    246246                substituteMembers( base->get_members(), baseParams, typeSubs );
     
    248248                deleteAll( baseParams );
    249249                baseParams.clear();
    250                
     250
    251251                dtypeStatics.insert( base );
    252252        }
     
    266266                        return inst;
    267267                }
    268                
     268
    269269                // check if type can be concretely instantiated; put substitutions into typeSubs
    270270                assert( inst->get_baseParameters() && "Base struct has parameters" );
     
    276276                        stripInstParams( inst );
    277277                        break;
    278                
     278
    279279                case genericType::concrete: {
    280280                        // make concrete instantiation of generic type
     
    328328                        stripInstParams( inst );
    329329                        break;
    330                        
     330
    331331                case genericType::concrete:
    332332                {
Note: See TracChangeset for help on using the changeset viewer.