Changes in / [e15ba975:7117ac3]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    re15ba975 r7117ac3  
    403403                        assert( aggr ); // TODO: need to handle forward declarations
    404404                        for ( Declaration * member : aggr->members ) {
    405                                 if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( child ) ) {
     405                                if ( StructInstType * inst = dynamic_cast< StructInstType * >( child ) ) {
     406                                        if ( StructDecl * aggr = dynamic_cast< StructDecl * >( member ) ) {
     407                                                if ( aggr->name == inst->name ) {
     408                                                        // TODO: is this case, and other non-TypeInstType cases, necessary?
     409                                                        return new StructInstType( qualType->get_qualifiers(), aggr );
     410                                                }
     411                                        }
     412                                } else if ( UnionInstType * inst = dynamic_cast< UnionInstType * >( child ) ) {
     413                                        if ( UnionDecl * aggr = dynamic_cast< UnionDecl * > ( member ) ) {
     414                                                if ( aggr->name == inst->name ) {
     415                                                        return new UnionInstType( qualType->get_qualifiers(), aggr );
     416                                                }
     417                                        }
     418                                } else if ( EnumInstType * inst = dynamic_cast< EnumInstType * >( child ) ) {
     419                                        if ( EnumDecl * aggr = dynamic_cast< EnumDecl * > ( member ) ) {
     420                                                if ( aggr->name == inst->name ) {
     421                                                        return new EnumInstType( qualType->get_qualifiers(), aggr );
     422                                                }
     423                                        }
     424                                } else if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( child ) ) {
    406425                                        // name on the right is a typedef
    407426                                        if ( NamedTypeDecl * aggr = dynamic_cast< NamedTypeDecl * > ( member ) ) {
     
    410429                                                        Type * ret = aggr->base->clone();
    411430                                                        ret->get_qualifiers() = qualType->get_qualifiers();
    412                                                         TypeSubstitution sub = parent->genericSubstitution();
    413                                                         sub.apply(ret);
    414431                                                        return ret;
    415432                                                }
Note: See TracChangeset for help on using the changeset viewer.