1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[llvm] Use llvm::any_of (NFC)

This commit is contained in:
Kazu Hirata 2021-01-19 20:19:15 -08:00
parent f118370581
commit 60a3732b33
3 changed files with 8 additions and 9 deletions

View File

@ -1204,7 +1204,7 @@ bool cl::ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer,
};
// Check for recursive response files.
if (std::any_of(FileStack.begin() + 1, FileStack.end(), IsEquivalent)) {
if (any_of(drop_begin(FileStack), IsEquivalent)) {
// This file is recursive, so we leave it in the argument stream and
// move on.
AllExpanded = false;

View File

@ -2451,8 +2451,8 @@ template <class ELFT> Error ELFWriter<ELFT>::finalize() {
if (Obj.sections().size() >= SHN_LORESERVE) {
SectionTableRef Sections = Obj.sections();
NeedsLargeIndexes =
std::any_of(Sections.begin() + SHN_LORESERVE, Sections.end(),
[](const SectionBase &Sec) { return Sec.HasSymbol; });
any_of(drop_begin(Sections, SHN_LORESERVE),
[](const SectionBase &Sec) { return Sec.HasSymbol; });
// TODO: handle case where only one section needs the large index table but
// only needs it because the large index table hasn't been removed yet.
}

View File

@ -218,12 +218,11 @@ FindUniqueOperandCommands(std::vector<std::string> &UniqueOperandCommands,
// Otherwise, scan to see if all of the other instructions in this command
// set share the operand.
if (std::any_of(Idxs.begin()+1, Idxs.end(),
[&](unsigned Idx) {
const AsmWriterInst &OtherInst = Instructions[Idx];
return OtherInst.Operands.size() == Op ||
OtherInst.Operands[Op] != FirstInst.Operands[Op];
}))
if (any_of(drop_begin(Idxs), [&](unsigned Idx) {
const AsmWriterInst &OtherInst = Instructions[Idx];
return OtherInst.Operands.size() == Op ||
OtherInst.Operands[Op] != FirstInst.Operands[Op];
}))
break;
// Okay, everything in this command set has the same next operand. Add it