Changeset 28f3a19 for src/SynTree/ReferenceToType.cc
- Timestamp:
- Jun 27, 2018, 3:28:41 PM (6 years ago)
- Branches:
- new-env, with_gc
- Children:
- b21c77a
- Parents:
- 0182bfa (diff), 63238a4 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/ReferenceToType.cc
r0182bfa r28f3a19 46 46 47 47 namespace { 48 void doLookup( const std::list< Declaration * > &members, const std::string &name, std::list< Declaration* > &foundDecls ) {49 for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i) {50 if ( (*i)->get_name()== name ) {51 foundDecls.push_back( *i);48 void doLookup( const std::list< Declaration * > & members, const std::string & name, std::list< Declaration* > & foundDecls ) { 49 for ( Declaration * decl : members ) { 50 if ( decl->name == name ) { 51 foundDecls.push_back( decl ); 52 52 } // if 53 53 } // for … … 56 56 57 57 StructInstType::StructInstType( const Type::Qualifiers & tq, StructDecl * baseStruct, const std::list< Attribute * > & attributes ) : 58 Parent( tq, baseStruct-> get_name(), attributes ), baseStruct( baseStruct ) {}58 Parent( tq, baseStruct->name, attributes ), baseStruct( baseStruct ) {} 59 59 60 60 std::string StructInstType::typeString() const { return "struct"; } … … 80 80 void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { 81 81 assert( baseStruct ); 82 doLookup( baseStruct-> get_members(), name, foundDecls );82 doLookup( baseStruct->members, name, foundDecls ); 83 83 } 84 84 … … 99 99 100 100 UnionInstType::UnionInstType( const Type::Qualifiers & tq, UnionDecl * baseUnion, const std::list< Attribute * > & attributes ) : 101 Parent( tq, baseUnion-> get_name(), attributes ), baseUnion( baseUnion ) {}101 Parent( tq, baseUnion->name, attributes ), baseUnion( baseUnion ) {} 102 102 103 103 std::string UnionInstType::typeString() const { return "union"; } … … 123 123 void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { 124 124 assert( baseUnion ); 125 doLookup( baseUnion-> get_members(), name, foundDecls );125 doLookup( baseUnion->members, name, foundDecls ); 126 126 } 127 127
Note: See TracChangeset
for help on using the changeset viewer.