Skip to content

Commit 62544cb

Browse files
nikicAlexisPerry
authored andcommitted
[WasmExceptionInfo] Use SmallPtrSet::remove_if() (NFC)
1 parent 2d0fcba commit 62544cb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyExceptionInfo.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ void WebAssemblyExceptionInfo::recalculate(
207207
auto *SrcWE = P.first;
208208
auto *DstWE = P.second;
209209

210-
for (auto *MBB : SrcWE->getBlocksSet()) {
210+
SrcWE->getBlocksSet().remove_if([&](MachineBasicBlock *MBB){
211211
if (MBB->isEHPad()) {
212212
assert(!isReachableAmongDominated(DstWE->getEHPad(), MBB,
213213
SrcWE->getEHPad(), MDT) &&
214214
"We already handled EH pads above");
215-
continue;
215+
return false;
216216
}
217217
if (isReachableAmongDominated(DstWE->getEHPad(), MBB, SrcWE->getEHPad(),
218218
MDT)) {
@@ -227,15 +227,16 @@ void WebAssemblyExceptionInfo::recalculate(
227227
InnerWE->removeFromBlocksSet(MBB);
228228
InnerWE = InnerWE->getParentException();
229229
}
230-
SrcWE->removeFromBlocksSet(MBB);
231230
LLVM_DEBUG(dbgs() << " removed from " << SrcWE->getEHPad()->getNumber()
232231
<< "." << SrcWE->getEHPad()->getName()
233232
<< "'s exception\n");
234233
changeExceptionFor(MBB, SrcWE->getParentException());
235234
if (SrcWE->getParentException())
236235
SrcWE->getParentException()->addToBlocksSet(MBB);
236+
return true;
237237
}
238-
}
238+
return false;
239+
});
239240
}
240241

241242
// Add BBs to exceptions' block vector

0 commit comments

Comments
 (0)