Changeset c36a419


Ignore:
Timestamp:
Nov 21, 2023, 2:27:10 PM (13 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
8984003
Parents:
4883712
Message:

Removed Decl::fromId as it was unused. There are a few places that use uniqueId directly.

Location:
src/AST
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.cpp

    r4883712 rc36a419  
    3333static UniqueId lastUniqueId = 0;
    3434
    35 using IdMapType = std::unordered_map< UniqueId, readonly<Decl> >;
    36 static IdMapType idMap;
    37 
    3835void Decl::fixUniqueId() {
    3936        if ( uniqueId ) return;  // ensure only set once
    4037        uniqueId = ++lastUniqueId;
    41         // The extra readonly pointer is causing some reference counting issues.
    42         // idMap[ uniqueId ] = this;
    43 }
    44 
    45 readonly<Decl> Decl::fromId( UniqueId id ) {
    46         // Right now this map is always empty, so don't use it.
    47         assert( false );
    48         IdMapType::const_iterator i = idMap.find( id );
    49         if ( i != idMap.end() ) return i->second;
    50         return {};
    5138}
    5239
  • src/AST/Decl.hpp

    r4883712 rc36a419  
    5656        /// Ensures this node has a unique ID
    5757        void fixUniqueId();
    58         /// Get canonical declaration for unique ID
    59         static readonly<Decl> fromId( UniqueId id );
    6058
    6159        const Decl * accept( Visitor & v ) const override = 0;
Note: See TracChangeset for help on using the changeset viewer.