| 1563 | } |
| 1564 | |
| 1565 | void cmComputeLinkDepends::VisitEntry(size_t index) |
| 1566 | { |
| 1567 | // Include this entry on the link line. |
| 1568 | this->FinalLinkOrder.push_back(index); |
| 1569 | |
| 1570 | // This entry has now been seen. Update its component. |
| 1571 | bool completed = false; |
| 1572 | size_t component = this->CCG->GetComponentMap()[index]; |
| 1573 | auto mi = this->PendingComponents.find(this->ComponentOrder[component]); |
| 1574 | if (mi != this->PendingComponents.end()) { |
| 1575 | // The entry is in an already pending component. |
| 1576 | PendingComponent& pc = mi->second; |
| 1577 | |
| 1578 | // Remove the entry from those pending in its component. |
| 1579 | pc.Entries.erase(index); |
| 1580 | if (pc.Entries.empty()) { |
| 1581 | // The complete component has been seen since it was last needed. |
| 1582 | --pc.Count; |
| 1583 | |
| 1584 | if (pc.Count == 0) { |
| 1585 | // The component has been completed. |
| 1586 | this->PendingComponents.erase(mi); |
| 1587 | completed = true; |
| 1588 | } else { |
| 1589 | // The whole component needs to be seen again. |
| 1590 | NodeList const& nl = this->CCG->GetComponent(component); |
| 1591 | assert(nl.size() > 1); |
| 1592 | pc.Entries.insert(nl.begin(), nl.end()); |
| 1593 | } |
| 1594 | } |
| 1595 | } else { |
| 1596 | // The entry is not in an already pending component. |
| 1597 | NodeList const& nl = this->CCG->GetComponent(component); |
| 1598 | if (nl.size() > 1) { |
| 1599 | // This is a non-trivial component. It is now pending. |
| 1600 | PendingComponent& pc = this->MakePendingComponent(component); |
| 1601 | |
| 1602 | // The starting entry has already been seen. |
| 1603 | pc.Entries.erase(index); |
| 1604 | } else { |
| 1605 | // This is a trivial component, so it is already complete. |
| 1606 | completed = true; |
| 1607 | } |
| 1608 | } |
| 1609 | |
| 1610 | // If the entry completed a component, the component's dependencies |
| 1611 | // are now pending. |
| 1612 | if (completed) { |
| 1613 | EdgeList const& ol = this->CCG->GetComponentGraphEdges(component); |
| 1614 | for (cmGraphEdge const& oi : ol) { |
| 1615 | // This entire component is now pending no matter whether it has |
| 1616 | // been partially seen already. |
| 1617 | this->MakePendingComponent(oi); |
| 1618 | } |
| 1619 | } |
| 1620 | } |
| 1621 | |
| 1622 | cmComputeLinkDepends::PendingComponent& |
no test coverage detected