Changeset 2cb70aa for src


Ignore:
Timestamp:
Jan 31, 2018, 4:42:38 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, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
84276ba
Parents:
5e2c348
Message:

Move Indexer unnamed object check into addId

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.impl.h

    r5e2c348 r2cb70aa  
    365365        maybeAccept_impl   ( node->attributes   , *this );
    366366
    367         if ( node->name != "" ) {
    368                 indexerAddId( node );
    369         }
     367        indexerAddId( node );
    370368
    371369        VISIT_END( node );
     
    381379        maybeMutate_impl   ( node->attributes   , *this );
    382380
    383         if ( node->name != "" ) {
    384                 indexerAddId( node );
    385         }
     381        indexerAddId( node );
    386382
    387383        MUTATE_END( DeclarationWithType, node );
     
    394390        VISIT_START( node );
    395391
    396         if ( node->name != "" ) {
    397                 indexerAddId( node );
    398         }
    399 
    400         {
     392        indexerAddId( node );
     393
     394        {
     395                // with clause introduces a level of scope (for the with expression members).
     396                // with clause exprs are added to the indexer before parameters so that parameters
     397                // shadow with exprs and not the other way around.
    401398                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    402399                // implicit add __func__ identifier as specified in the C manual 6.4.2.2
     
    419416        MUTATE_START( node );
    420417
    421         if ( node->name != "" ) {
    422                 indexerAddId( node );
    423         }
    424 
    425         {
     418        indexerAddId( node );
     419
     420        {
     421                // with clause introduces a level of scope (for the with expression members).
     422                // with clause exprs are added to the indexer before parameters so that parameters
     423                // shadow with exprs and not the other way around.
    426424                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    427425                // implicit add __func__ identifier as specified in the C manual 6.4.2.2
  • src/SymTab/Indexer.cc

    r5e2c348 r2cb70aa  
    409409
    410410        void Indexer::addId( DeclarationWithType *decl, Expression * baseExpr ) {
     411                if ( decl->name == "" ) return;
    411412                debugPrint( "Adding Id " << decl->name << std::endl );
    412413                makeWritable();
Note: See TracChangeset for help on using the changeset viewer.