Changeset 7de7b52 for src/SynTree/ReferenceToType.cc
- Timestamp:
- Jun 1, 2018, 1:36:11 PM (6 years ago)
- 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, with_gc
- Children:
- 262bd63, e8db295
- Parents:
- 6810fcb (diff), 41e16b1 (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
r6810fcb r7de7b52 50 50 51 51 namespace { 52 void doLookup( const std::list< Declaration * > &members, const std::string &name, std::list< Declaration* > &foundDecls ) {53 for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i) {54 if ( (*i)->get_name()== name ) {55 foundDecls.push_back( *i);52 void doLookup( const std::list< Declaration * > & members, const std::string & name, std::list< Declaration* > & foundDecls ) { 53 for ( Declaration * decl : members ) { 54 if ( decl->name == name ) { 55 foundDecls.push_back( decl ); 56 56 } // if 57 57 } // for … … 60 60 61 61 StructInstType::StructInstType( const Type::Qualifiers & tq, StructDecl * baseStruct, const std::list< Attribute * > & attributes ) : 62 Parent( tq, baseStruct-> get_name(), attributes ), baseStruct( baseStruct ) {}62 Parent( tq, baseStruct->name, attributes ), baseStruct( baseStruct ) {} 63 63 64 64 std::string StructInstType::typeString() const { return "struct"; } … … 84 84 void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { 85 85 assert( baseStruct ); 86 doLookup( baseStruct-> get_members(), name, foundDecls );86 doLookup( baseStruct->members, name, foundDecls ); 87 87 } 88 88 … … 103 103 104 104 UnionInstType::UnionInstType( const Type::Qualifiers & tq, UnionDecl * baseUnion, const std::list< Attribute * > & attributes ) : 105 Parent( tq, baseUnion-> get_name(), attributes ), baseUnion( baseUnion ) {}105 Parent( tq, baseUnion->name, attributes ), baseUnion( baseUnion ) {} 106 106 107 107 std::string UnionInstType::typeString() const { return "union"; } … … 127 127 void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { 128 128 assert( baseUnion ); 129 doLookup( baseUnion-> get_members(), name, foundDecls );129 doLookup( baseUnion->members, name, foundDecls ); 130 130 } 131 131
Note: See TracChangeset
for help on using the changeset viewer.