1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[ExecutionEngine, Linker] Use erase_if (NFC)

This commit is contained in:
Kazu Hirata 2020-12-23 21:44:39 -08:00
parent b3956a9858
commit eea8d75638
2 changed files with 4 additions and 7 deletions

View File

@ -218,11 +218,9 @@ SectionMemoryManager::applyMemoryGroupPermissions(MemoryGroup &MemGroup,
}
// Remove all blocks which are now empty
MemGroup.FreeMem.erase(remove_if(MemGroup.FreeMem,
[](FreeMemBlock &FreeMB) {
erase_if(MemGroup.FreeMem, [](FreeMemBlock &FreeMB) {
return FreeMB.Free.allocatedSize() == 0;
}),
MemGroup.FreeMem.end());
});
return std::error_code();
}

View File

@ -905,7 +905,7 @@ IRLinker::linkAppendingVarProto(GlobalVariable *DstGV,
getArrayElements(SrcGV->getInitializer(), SrcElements);
if (IsNewStructor) {
auto It = remove_if(SrcElements, [this](Constant *E) {
erase_if(SrcElements, [this](Constant *E) {
auto *Key =
dyn_cast<GlobalValue>(E->getAggregateElement(2)->stripPointerCasts());
if (!Key)
@ -913,7 +913,6 @@ IRLinker::linkAppendingVarProto(GlobalVariable *DstGV,
GlobalValue *DGV = getLinkedToGlobal(Key);
return !shouldLink(DGV, *Key);
});
SrcElements.erase(It, SrcElements.end());
}
uint64_t NewSize = DstNumElements + SrcElements.size();
ArrayType *NewType = ArrayType::get(EltTy, NewSize);