Changes in / [87959f6:6ba16fa]
- Location:
- src/SymTab
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/SymTab/Indexer.cc ¶
r87959f6 r6ba16fa 572 572 } 573 573 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 590 574 void Indexer::addWith( WithStmt * stmt ) { 591 575 for ( Expression * expr : stmt->exprs ) { … … 594 578 assertf( aggr, "WithStmt expr has non-aggregate type: %s", toString( expr->result ).c_str() ); 595 579 596 addMembers( aggr, expr ); 580 for ( Declaration * decl : aggr->members ) { 581 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) { 582 addId( dwt, expr ); 583 } 584 } 597 585 } 598 586 } -
TabularUnified src/SymTab/Indexer.h ¶
r87959f6 r6ba16fa 86 86 void addWith( WithStmt * ); 87 87 88 /// adds all of the members of the Aggregate (addWith helper)89 void addMembers( AggregateDecl * aggr, Expression * expr );90 91 88 /// convenience function for adding a list of Ids to the indexer 92 89 void addIds( const std::list< DeclarationWithType * > & decls );
Note: See TracChangeset
for help on using the changeset viewer.