diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp index ab5bb88759e5a..888d3c113c914 100644 --- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp @@ -1281,10 +1281,9 @@ static bool areCFlagsAccessedBetweenInstrs( return true; // From must be above To. - assert(std::find_if(++To.getReverse(), To->getParent()->rend(), - [From](MachineInstr &MI) { - return MI.getIterator() == From; - }) != To->getParent()->rend()); + assert(std::any_of( + ++To.getReverse(), To->getParent()->rend(), + [From](MachineInstr &MI) { return MI.getIterator() == From; })); // We iterate backward starting at \p To until we hit \p From. for (const MachineInstr &Instr : diff --git a/llvm/tools/obj2yaml/elf2yaml.cpp b/llvm/tools/obj2yaml/elf2yaml.cpp index 3c7f6dd8319db..494aa5b17b131 100644 --- a/llvm/tools/obj2yaml/elf2yaml.cpp +++ b/llvm/tools/obj2yaml/elf2yaml.cpp @@ -187,7 +187,7 @@ bool ELFDumper::shouldPrintSection(const ELFYAML::Section &S, if (S.Type == ELF::SHT_NULL && (&SHdr == &Sections[0])) { const uint8_t *Begin = reinterpret_cast(&SHdr); const uint8_t *End = Begin + sizeof(Elf_Shdr); - return std::find_if(Begin, End, [](uint8_t V) { return V != 0; }) != End; + return std::any_of(Begin, End, [](uint8_t V) { return V != 0; }); } // Normally we use "DWARF:" to describe contents of DWARF sections. Sometimes