Orc fix waitingongraph coalescer remove (#169287)
This commit is contained in:
parent
d9cf0db2a2
commit
73de1e26b4
@ -155,22 +155,20 @@ private:
|
||||
}
|
||||
|
||||
template <typename Pred> void remove(Pred &&Remove) {
|
||||
std::vector<hash_code> HashesToErase;
|
||||
for (auto &[Hash, SNs] : CanonicalSNs) {
|
||||
bool Found = false;
|
||||
for (size_t I = 0; I != SNs.size(); ++I) {
|
||||
for (size_t I = 0; I != SNs.size();) {
|
||||
if (Remove(SNs[I])) {
|
||||
std::swap(SNs[I], SNs.back());
|
||||
SNs.pop_back();
|
||||
Found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (Found) {
|
||||
if (SNs.empty())
|
||||
CanonicalSNs.erase(Hash);
|
||||
break;
|
||||
} else
|
||||
++I;
|
||||
}
|
||||
if (SNs.empty())
|
||||
HashesToErase.push_back(Hash);
|
||||
}
|
||||
for (auto Hash : HashesToErase)
|
||||
CanonicalSNs.erase(Hash);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -396,9 +394,14 @@ public:
|
||||
++I;
|
||||
}
|
||||
|
||||
CoalesceToPendingSNs.remove([&](SuperNode *SN) {
|
||||
for (auto &E : FailedSNs)
|
||||
if (E.get() == SN)
|
||||
return true;
|
||||
return false;
|
||||
});
|
||||
|
||||
for (auto &SN : FailedSNs) {
|
||||
CoalesceToPendingSNs.remove(
|
||||
[&](SuperNode *SNC) { return SNC == SN.get(); });
|
||||
for (auto &[Container, Elems] : SN->Defs) {
|
||||
assert(ElemToPendingSN.count(Container));
|
||||
auto &CElems = ElemToPendingSN[Container];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user