Ignore:
Timestamp:
Nov 20, 2015, 10:32:05 AM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
66a2a61
Parents:
f066321 (diff), 258eb5c9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of /u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/TypeSubstitution.cc

    rf066321 r63afee0  
    126126Type *TypeSubstitution::handleType( TypeClass *type ) {
    127127        BoundVarsType oldBoundVars( boundVars );
     128        // bind type variables from forall-qualifiers
    128129        if ( freeOnly ) {
    129130                for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
     
    136137}
    137138
     139template< typename TypeClass >
     140Type *TypeSubstitution::handleAggregateType( TypeClass *type ) {
     141        BoundVarsType oldBoundVars( boundVars );
     142        // bind type variables from forall-qualifiers
     143        if ( freeOnly ) {
     144                for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
     145                        boundVars.insert( (*tyvar )->get_name() );
     146                } // for
     147        } // if
     148        // bind type variables from generic type instantiations
     149        for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_baseParameters().begin(); tyvar != type->get_baseParameters().end(); ++tyvar ) {
     150                boundVars.insert( (*tyvar)->get_name() );
     151        } // for
     152        Type *ret = Mutator::mutate( type );
     153        boundVars = oldBoundVars;
     154        return ret;
     155}
     156
    138157Type * TypeSubstitution::mutate( VoidType *basicType ) {
    139158        return handleType( basicType );
     
    157176
    158177Type * TypeSubstitution::mutate( StructInstType *aggregateUseType ) {
    159         return handleType( aggregateUseType );
     178        return handleAggregateType( aggregateUseType );
    160179}
    161180
    162181Type * TypeSubstitution::mutate( UnionInstType *aggregateUseType ) {
    163         return handleType( aggregateUseType );
     182        return handleAggregateType( aggregateUseType );
    164183}
    165184
Note: See TracChangeset for help on using the changeset viewer.