Changeset 561354f for src/AST/SymbolTable.cpp
- Timestamp:
- May 17, 2023, 1:33:39 AM (12 months ago)
- Branches:
- ADT
- Children:
- d6c464d
- Parents:
- 28f8f15
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/SymbolTable.cpp
r28f8f15 r561354f 358 358 } 359 359 360 void SymbolTable::addAdt( const AdtDecl *decl ) { 361 ++*stats().add_calls; 362 const std::string &id = decl->name; 363 364 if ( ! adtTable ) { 365 adtTable = AdtTable::new_ptr(); 366 } else { 367 ++*stats().map_lookups; 368 auto existing = adtTable->find( id ); 369 if ( existing != adtTable->end() 370 && existing->second.scope == scope 371 && addedDeclConflicts( existing->second.decl, decl ) ) return; 372 373 } 374 375 lazyInitScope(); 376 ++*stats().map_mutations; 377 adtTable = adtTable->set( id, scoped<AdtDecl>{ decl, scope }); 378 } 379 360 380 void SymbolTable::addUnion( const std::string &id ) { 361 381 addUnion( new UnionDecl( CodeLocation(), id ) );
Note: See TracChangeset
for help on using the changeset viewer.