mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:29:51 +00:00
[llvm] Use llvm::erase_value and llvm::erase_if (NFC)
This commit is contained in:
parent
201d0ba7d2
commit
ae4745f165
@ -804,13 +804,9 @@ void WinEHPrepare::cloneCommonBlocks(Function &F) {
|
|||||||
<< "\' to block \'" << NewBlock->getName()
|
<< "\' to block \'" << NewBlock->getName()
|
||||||
<< "\'.\n");
|
<< "\'.\n");
|
||||||
|
|
||||||
BlocksInFunclet.erase(
|
llvm::erase_value(BlocksInFunclet, OldBlock);
|
||||||
std::remove(BlocksInFunclet.begin(), BlocksInFunclet.end(), OldBlock),
|
|
||||||
BlocksInFunclet.end());
|
|
||||||
ColorVector &OldColors = BlockColors[OldBlock];
|
ColorVector &OldColors = BlockColors[OldBlock];
|
||||||
OldColors.erase(
|
llvm::erase_value(OldColors, FuncletPadBB);
|
||||||
std::remove(OldColors.begin(), OldColors.end(), FuncletPadBB),
|
|
||||||
OldColors.end());
|
|
||||||
|
|
||||||
DEBUG_WITH_TYPE("winehprepare-coloring",
|
DEBUG_WITH_TYPE("winehprepare-coloring",
|
||||||
dbgs() << " Removed color \'" << FuncletPadBB->getName()
|
dbgs() << " Removed color \'" << FuncletPadBB->getName()
|
||||||
|
@ -997,7 +997,7 @@ OperandMatchResultTy HexagonAsmParser::tryParseRegister(unsigned &RegNo,
|
|||||||
NeededWorkaround = NeededWorkaround || (Again && !(Contigious && Type));
|
NeededWorkaround = NeededWorkaround || (Again && !(Contigious && Type));
|
||||||
}
|
}
|
||||||
std::string Collapsed = std::string(RawString);
|
std::string Collapsed = std::string(RawString);
|
||||||
Collapsed.erase(llvm::remove_if(Collapsed, isSpace), Collapsed.end());
|
llvm::erase_if(Collapsed, isSpace);
|
||||||
StringRef FullString = Collapsed;
|
StringRef FullString = Collapsed;
|
||||||
std::pair<StringRef, StringRef> DotSplit = FullString.split('.');
|
std::pair<StringRef, StringRef> DotSplit = FullString.split('.');
|
||||||
unsigned DotReg = matchRegister(DotSplit.first.lower());
|
unsigned DotReg = matchRegister(DotSplit.first.lower());
|
||||||
|
@ -39,7 +39,7 @@ inline bool isNumericRegex(llvm::StringRef S) {
|
|||||||
|
|
||||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||||
std::string Input(reinterpret_cast<const char *>(Data), Size);
|
std::string Input(reinterpret_cast<const char *>(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))
|
if (!Input.empty() && llvm::yaml::isNumeric(Input) != isNumericRegex(Input))
|
||||||
LLVM_BUILTIN_TRAP;
|
LLVM_BUILTIN_TRAP;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -25,7 +25,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|||||||
isValidYaml(Input.data(), Input.size());
|
isValidYaml(Input.data(), Input.size());
|
||||||
|
|
||||||
// Ensure we don't crash on byte strings with no null characters.
|
// 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();
|
Input.shrink_to_fit();
|
||||||
bool IsValidWithout0s = isValidYaml(Input.data(), Input.size());
|
bool IsValidWithout0s = isValidYaml(Input.data(), Input.size());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user