Ignore:
Timestamp:
Jun 1, 2018, 1:36:11 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/ReferenceToType.cc

    r6810fcb r7de7b52  
    5050
    5151namespace {
    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 );
    5656                        } // if
    5757                } // for
     
    6060
    6161StructInstType::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 ) {}
    6363
    6464std::string StructInstType::typeString() const { return "struct"; }
     
    8484void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
    8585        assert( baseStruct );
    86         doLookup( baseStruct->get_members(), name, foundDecls );
     86        doLookup( baseStruct->members, name, foundDecls );
    8787}
    8888
     
    103103
    104104UnionInstType::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 ) {}
    106106
    107107std::string UnionInstType::typeString() const { return "union"; }
     
    127127void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
    128128        assert( baseUnion );
    129         doLookup( baseUnion->get_members(), name, foundDecls );
     129        doLookup( baseUnion->members, name, foundDecls );
    130130}
    131131
Note: See TracChangeset for help on using the changeset viewer.