diff --git a/lib/CodeGen/WinEHPrepare.cpp b/lib/CodeGen/WinEHPrepare.cpp index 5a25234ba85..96d256ba57a 100644 --- a/lib/CodeGen/WinEHPrepare.cpp +++ b/lib/CodeGen/WinEHPrepare.cpp @@ -804,13 +804,9 @@ void WinEHPrepare::cloneCommonBlocks(Function &F) { << "\' to block \'" << NewBlock->getName() << "\'.\n"); - BlocksInFunclet.erase( - std::remove(BlocksInFunclet.begin(), BlocksInFunclet.end(), OldBlock), - BlocksInFunclet.end()); + llvm::erase_value(BlocksInFunclet, OldBlock); ColorVector &OldColors = BlockColors[OldBlock]; - OldColors.erase( - std::remove(OldColors.begin(), OldColors.end(), FuncletPadBB), - OldColors.end()); + llvm::erase_value(OldColors, FuncletPadBB); DEBUG_WITH_TYPE("winehprepare-coloring", dbgs() << " Removed color \'" << FuncletPadBB->getName() diff --git a/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp b/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp index 39945ac3b1c..b6763fd9aef 100644 --- a/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp +++ b/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp @@ -997,7 +997,7 @@ OperandMatchResultTy HexagonAsmParser::tryParseRegister(unsigned &RegNo, NeededWorkaround = NeededWorkaround || (Again && !(Contigious && Type)); } std::string Collapsed = std::string(RawString); - Collapsed.erase(llvm::remove_if(Collapsed, isSpace), Collapsed.end()); + llvm::erase_if(Collapsed, isSpace); StringRef FullString = Collapsed; std::pair DotSplit = FullString.split('.'); unsigned DotReg = matchRegister(DotSplit.first.lower()); diff --git a/tools/llvm-yaml-numeric-parser-fuzzer/yaml-numeric-parser-fuzzer.cpp b/tools/llvm-yaml-numeric-parser-fuzzer/yaml-numeric-parser-fuzzer.cpp index 3f50d60bc12..7ffc75e66a5 100644 --- a/tools/llvm-yaml-numeric-parser-fuzzer/yaml-numeric-parser-fuzzer.cpp +++ b/tools/llvm-yaml-numeric-parser-fuzzer/yaml-numeric-parser-fuzzer.cpp @@ -39,7 +39,7 @@ inline bool isNumericRegex(llvm::StringRef S) { extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { std::string Input(reinterpret_cast(Data), Size); - Input.erase(std::remove(Input.begin(), Input.end(), 0), Input.end()); + llvm::erase_value(Input, 0); if (!Input.empty() && llvm::yaml::isNumeric(Input) != isNumericRegex(Input)) LLVM_BUILTIN_TRAP; return 0; diff --git a/tools/llvm-yaml-parser-fuzzer/yaml-parser-fuzzer.cpp b/tools/llvm-yaml-parser-fuzzer/yaml-parser-fuzzer.cpp index 3aeaf02f3e7..007769fd047 100644 --- a/tools/llvm-yaml-parser-fuzzer/yaml-parser-fuzzer.cpp +++ b/tools/llvm-yaml-parser-fuzzer/yaml-parser-fuzzer.cpp @@ -25,7 +25,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { isValidYaml(Input.data(), Input.size()); // Ensure we don't crash on byte strings with no null characters. - Input.erase(std::remove(Input.begin(), Input.end(), 0), Input.end()); + llvm::erase_value(Input, 0); Input.shrink_to_fit(); bool IsValidWithout0s = isValidYaml(Input.data(), Input.size());