[llvm] 4c1617d - [llvm] Use std::any_of (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 13 19:15:22 PST 2021
Author: Kazu Hirata
Date: 2021-01-13T19:14:44-08:00
New Revision: 4c1617dac8fa13a8eac9cc4ac13a8f1fb3da512e
URL: https://github.com/llvm/llvm-project/commit/4c1617dac8fa13a8eac9cc4ac13a8f1fb3da512e
DIFF: https://github.com/llvm/llvm-project/commit/4c1617dac8fa13a8eac9cc4ac13a8f1fb3da512e.diff
LOG: [llvm] Use std::any_of (NFC)
Added:
Modified:
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/tools/obj2yaml/elf2yaml.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index ab5bb88759e5..888d3c113c91 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 3c7f6dd8319d..494aa5b17b13 100644
--- a/llvm/tools/obj2yaml/elf2yaml.cpp
+++ b/llvm/tools/obj2yaml/elf2yaml.cpp
@@ -187,7 +187,7 @@ bool ELFDumper<ELFT>::shouldPrintSection(const ELFYAML::Section &S,
if (S.Type == ELF::SHT_NULL && (&SHdr == &Sections[0])) {
const uint8_t *Begin = reinterpret_cast<const uint8_t *>(&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
More information about the llvm-commits
mailing list