Changeset 561354f for src/SymTab
- Timestamp:
- May 17, 2023, 1:33:39 AM (3 years ago)
- Branches:
- ADT
- Children:
- d6c464d
- Parents:
- 28f8f15
- Location:
- src/SymTab
- Files:
-
- 2 edited
-
Indexer.cc (modified) (1 diff)
-
Indexer.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Indexer.cc
r28f8f15 r561354f 606 606 } 607 607 608 void Indexer::addAdt( const AdtDecl * decl ) { 609 ++*stats().add_calls; 610 const std::string & id = decl->name; 611 612 if ( ! adtTable ) { 613 adtTable = AdtTable::new_ptr(); 614 } else { 615 ++* stats().map_lookups; 616 auto existing = adtTable->find( id ); 617 if ( existing != adtTable->end() 618 && existing->second.scope == scope 619 && addedDeclConflicts( existing->second.decl, decl ) ) return; 620 621 } 622 623 lazyInitScope(); 624 ++* stats().map_mutations; 625 adtTable = adtTable->set( id, Scoped<AdtDecl>{ decl, scope} ); 626 } 627 608 628 void Indexer::addUnion( const std::string & id ) { 609 629 addUnion( new UnionDecl( id ) ); -
src/SymTab/Indexer.h
r28f8f15 r561354f 89 89 void addStruct( const StructDecl * decl ); 90 90 void addEnum( const EnumDecl * decl ); 91 void addAdt( const AdtDecl * decl ); 91 92 void addUnion( const std::string & id ); 92 93 void addUnion( const UnionDecl * decl ); … … 124 125 using UnionTable = PersistentMap< std::string, Scoped<UnionDecl> >; 125 126 using TraitTable = PersistentMap< std::string, Scoped<TraitDecl> >; 127 using AdtTable = PersistentMap< std::string, Scoped<AdtDecl> >; 126 128 127 129 IdTable::Ptr idTable; ///< identifier namespace … … 131 133 UnionTable::Ptr unionTable; ///< union namespace 132 134 TraitTable::Ptr traitTable; ///< trait namespace 135 AdtTable::Ptr adtTable; ///< adt namespace 133 136 134 137 Ptr prevScope; ///< reference to indexer for parent scope
Note:
See TracChangeset
for help on using the changeset viewer.