Changeset 21a2a7d
- Timestamp:
- Feb 3, 2023, 4:04:22 PM (22 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 35d1de5
- Parents:
- e9b5043
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/ScopedMap.h
re9b5043 r21a2a7d 167 167 } 168 168 169 iterator erase( iterator pos ); 169 /// Erases element with key in the innermost scope that has it. 170 size_type erase( const Key & key ) { 171 for ( auto it = scopes.rbegin() ; it != scopes.rend() ; ++it ) { 172 if ( size_type i = it->map.erase( key ) ; 0 != i ) return i; 173 } 174 return 0; 175 } 170 176 171 177 size_type count( const Key & key ) const { … … 345 351 }; 346 352 347 template<typename Key, typename Value, typename Note>348 typename ScopedMap<Key, Value, Note>::iterator349 ScopedMap<Key, Value, Note>::erase( iterator pos ) {350 MapType & scope = (*pos.scopes)[ pos.level ].map;351 const typename iterator::wrapped_iterator & new_it = scope.erase( pos.it );352 iterator it( *pos.scopes, new_it, pos.level );353 return it.next_valid();354 }355 356 353 // Local Variables: // 357 354 // tab-width: 4 // -
src/SymTab/Validate.cc
re9b5043 r21a2a7d 863 863 864 864 void ReplaceTypedef::premutate( TypeDecl * typeDecl ) { 865 TypedefMap::iterator i = typedefNames.find( typeDecl->name ); 866 if ( i != typedefNames.end() ) { 867 typedefNames.erase( i ) ; 868 } // if 869 865 typedefNames.erase( typeDecl->name ); 870 866 typedeclNames.insert( typeDecl->name, typeDecl ); 871 867 } -
src/Validate/ReplaceTypedef.cpp
re9b5043 r21a2a7d 186 186 187 187 void ReplaceTypedefCore::previsit( ast::TypeDecl const * decl ) { 188 TypedefMap::iterator iter = typedefNames.find( decl->name ); 189 if ( iter != typedefNames.end() ) { 190 typedefNames.erase( iter ); 191 } 188 typedefNames.erase( decl->name ); 192 189 typedeclNames.insert( decl->name, decl ); 193 190 }
Note: See TracChangeset
for help on using the changeset viewer.