Remove matching parents/neighbors in subgraphs

This ensures that when bus elements or labels matching bus elements are
removed that the stale neighbor/parent references are similarly removed

Matching 7.0 commit 4cdf75dc72
This commit is contained in:
Seth Hillbrand 2023-05-03 13:37:11 -07:00
parent b72c6e5cb0
commit 8b73b0549f
1 changed files with 40 additions and 0 deletions

View File

@ -705,6 +705,44 @@ void CONNECTION_GRAPH::removeSubgraphs( std::set<CONNECTION_SUBGRAPH*>& aSubgrap
for( CONNECTION_SUBGRAPH* sg : aSubgraphs )
{
for( auto it : sg->m_bus_neighbors )
{
for( CONNECTION_SUBGRAPH* neighbor : it.second )
{
auto& parents = neighbor->m_bus_parents[it.first];
for( auto test = parents.begin(); test != parents.end(); )
{
if( *test == sg )
test = parents.erase( test );
else
++test;
}
if( parents.empty() )
neighbor->m_bus_parents.erase( it.first );
}
}
for( auto it : sg->m_bus_parents )
{
for( CONNECTION_SUBGRAPH* parent : it.second )
{
auto& neighbors = parent->m_bus_neighbors[it.first];
for( auto test = neighbors.begin(); test != neighbors.end(); )
{
if( *test == sg )
test = neighbors.erase( test );
else
++test;
}
if( neighbors.empty() )
parent->m_bus_neighbors.erase( it.first );
}
}
{
auto it = std::lower_bound( m_driver_subgraphs.begin(), m_driver_subgraphs.end(), sg );
@ -780,6 +818,8 @@ void CONNECTION_GRAPH::removeSubgraphs( std::set<CONNECTION_SUBGRAPH*>& aSubgrap
else
++it;
}
}
for( auto it = m_net_name_to_code_map.begin(); it != m_net_name_to_code_map.end(); )