Changes in / [87959f6:6ba16fa]


Ignore:
Location:
src/SymTab
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/SymTab/Indexer.cc

    r87959f6 r6ba16fa  
    572572        }
    573573
    574         void Indexer::addMembers( AggregateDecl * aggr, Expression * expr ) {
    575                 for ( Declaration * decl : aggr->members ) {
    576                         if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {
    577                                 addId( dwt, expr );
    578                                 if ( dwt->name == "" ) {
    579                                         Type * t = dwt->get_type()->stripReferences();
    580                                         if ( dynamic_cast< StructInstType * >( t ) || dynamic_cast< UnionInstType * >( t ) ) {
    581                                                 Expression * base = expr->clone();
    582                                                 ResolvExpr::referenceToRvalueConversion( base );
    583                                                 addMembers( t->getAggr(), new MemberExpr( dwt, base ) );
    584                                         }
    585                                 }
    586                         }
    587                 }
    588         }
    589 
    590574        void Indexer::addWith( WithStmt * stmt ) {
    591575                for ( Expression * expr : stmt->exprs ) {
     
    594578                                assertf( aggr, "WithStmt expr has non-aggregate type: %s", toString( expr->result ).c_str() );
    595579
    596                                 addMembers( aggr, expr );
     580                                for ( Declaration * decl : aggr->members ) {
     581                                        if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {
     582                                                addId( dwt, expr );
     583                                        }
     584                                }
    597585                        }
    598586                }
  • TabularUnified src/SymTab/Indexer.h

    r87959f6 r6ba16fa  
    8686                void addWith( WithStmt * );
    8787
    88                 /// adds all of the members of the Aggregate (addWith helper)
    89                 void addMembers( AggregateDecl * aggr, Expression * expr );
    90 
    9188                /// convenience function for adding a list of Ids to the indexer
    9289                void addIds( const std::list< DeclarationWithType * > & decls );
Note: See TracChangeset for help on using the changeset viewer.