diff --git a/lib/ExecutionEngine/SectionMemoryManager.cpp b/lib/ExecutionEngine/SectionMemoryManager.cpp index 138b18a1ddc..6690dd07d99 100644 --- a/lib/ExecutionEngine/SectionMemoryManager.cpp +++ b/lib/ExecutionEngine/SectionMemoryManager.cpp @@ -218,11 +218,9 @@ SectionMemoryManager::applyMemoryGroupPermissions(MemoryGroup &MemGroup, } // Remove all blocks which are now empty - MemGroup.FreeMem.erase(remove_if(MemGroup.FreeMem, - [](FreeMemBlock &FreeMB) { - return FreeMB.Free.allocatedSize() == 0; - }), - MemGroup.FreeMem.end()); + erase_if(MemGroup.FreeMem, [](FreeMemBlock &FreeMB) { + return FreeMB.Free.allocatedSize() == 0; + }); return std::error_code(); } diff --git a/lib/Linker/IRMover.cpp b/lib/Linker/IRMover.cpp index b7a9beeeeb1..5eeba0c0c3e 100644 --- a/lib/Linker/IRMover.cpp +++ b/lib/Linker/IRMover.cpp @@ -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(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);