Ignore:
Timestamp:
Mar 8, 2018, 9:23:32 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
4c11fce, ab0203df
Parents:
e5d4e5c (diff), fb11446e (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 plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    re5d4e5c r5600747  
    345345}
    346346
    347 namespace {
    348         TypeSubstitution makeSub( Type * t ) {
    349                 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( t ) ) {
    350                         return makeSub( refType->get_base() );
    351                 } else if ( StructInstType * aggInst = dynamic_cast< StructInstType * >( t ) ) {
    352                         return TypeSubstitution( aggInst->get_baseParameters()->begin(), aggInst->get_baseParameters()->end(), aggInst->parameters.begin() );
    353                 } else if ( UnionInstType * aggInst = dynamic_cast< UnionInstType * >( t ) ) {
    354                         return TypeSubstitution( aggInst->get_baseParameters()->begin(), aggInst->get_baseParameters()->end(), aggInst->parameters.begin() );
    355                 } else {
    356                         assertf( false, "makeSub expects struct or union type for aggregate, but got: %s", toString( t ).c_str() );
    357                 }
    358         }
    359 }
    360 
    361 
    362347MemberExpr::MemberExpr( DeclarationWithType *member, Expression *aggregate ) :
    363348                Expression(), member(member), aggregate(aggregate) {
    364349        assert( member );
    365350        assert( aggregate );
    366 
    367         TypeSubstitution sub( makeSub( aggregate->get_result() ) );
     351        assert( aggregate->result );
     352
     353        TypeSubstitution sub = aggregate->result->genericSubstitution();
    368354        Type * res = member->get_type()->clone();
    369355        sub.apply( res );
Note: See TracChangeset for help on using the changeset viewer.