Ignore:
Timestamp:
Jun 27, 2018, 3:28:41 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
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.
Message:

Merge branch 'master' into with_gc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/ReferenceToType.cc

    r0182bfa r28f3a19  
    4646
    4747namespace {
    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 );
    5252                        } // if
    5353                } // for
     
    5656
    5757StructInstType::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 ) {}
    5959
    6060std::string StructInstType::typeString() const { return "struct"; }
     
    8080void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
    8181        assert( baseStruct );
    82         doLookup( baseStruct->get_members(), name, foundDecls );
     82        doLookup( baseStruct->members, name, foundDecls );
    8383}
    8484
     
    9999
    100100UnionInstType::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 ) {}
    102102
    103103std::string UnionInstType::typeString() const { return "union"; }
     
    123123void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
    124124        assert( baseUnion );
    125         doLookup( baseUnion->get_members(), name, foundDecls );
     125        doLookup( baseUnion->members, name, foundDecls );
    126126}
    127127
Note: See TracChangeset for help on using the changeset viewer.