Ignore:
Timestamp:
Jun 19, 2018, 2:13:34 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
c194661
Parents:
47498bd
git-author:
Rob Schluntz <rschlunt@…> (06/19/18 14:13:29)
git-committer:
Rob Schluntz <rschlunt@…> (06/19/18 14:13:34)
Message:

Fix lookup{SUE}AtScope? functions to look in only a specific scope and provide lookupAtGlobalScope functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Indexer.cc

    r47498bd r9a7a3b6  
    272272        }
    273273
     274        StructDecl *Indexer::globalLookupStruct( const std::string &id ) const {
     275                return lookupStructAtScope( id, 0 );
     276        }
     277
     278        UnionDecl *Indexer::globalLookupUnion( const std::string &id ) const {
     279                return lookupUnionAtScope( id, 0 );
     280        }
     281
     282        EnumDecl *Indexer::globalLookupEnum( const std::string &id ) const {
     283                return lookupEnumAtScope( id, 0 );
     284        }
     285
    274286        EnumDecl *Indexer::lookupEnum( const std::string &id ) const {
    275287                if ( ! tables ) return 0;
     
    347359                if ( ! tables ) return 0;
    348360                if ( tables->scope < scope ) return 0;
     361                if ( tables->scope > scope ) return tables->base.lookupTypeAtScope( id, scope );
    349362
    350363                TypeTable::const_iterator ret = tables->typeTable.find( id );
     
    355368                if ( ! tables ) return 0;
    356369                if ( tables->scope < scope ) return 0;
     370                if ( tables->scope > scope ) return tables->base.lookupStructAtScope( id, scope );
    357371
    358372                StructTable::const_iterator ret = tables->structTable.find( id );
     
    363377                if ( ! tables ) return 0;
    364378                if ( tables->scope < scope ) return 0;
     379                if ( tables->scope > scope ) return tables->base.lookupEnumAtScope( id, scope );
    365380
    366381                EnumTable::const_iterator ret = tables->enumTable.find( id );
     
    371386                if ( ! tables ) return 0;
    372387                if ( tables->scope < scope ) return 0;
     388                if ( tables->scope > scope ) return tables->base.lookupUnionAtScope( id, scope );
    373389
    374390                UnionTable::const_iterator ret = tables->unionTable.find( id );
     
    379395                if ( ! tables ) return 0;
    380396                if ( tables->scope < scope ) return 0;
     397                if ( tables->scope > scope ) return tables->base.lookupTraitAtScope( id, scope );
    381398
    382399                TraitTable::const_iterator ret = tables->traitTable.find( id );
Note: See TracChangeset for help on using the changeset viewer.