summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-01-13 19:14:44 -0800
committerKazu Hirata <kazu@google.com>2021-01-13 19:14:44 -0800
commit4c1617dac8fa13a8eac9cc4ac13a8f1fb3da512e (patch)
treeb708030b230ea46e418bc9d535c5e5b85f34e08f
parent125ea20d55c554fbe14eb1f6cff7d44a720a51f5 (diff)
downloadllvm-4c1617dac8fa13a8eac9cc4ac13a8f1fb3da512e.tar.gz
[llvm] Use std::any_of (NFC)
-rw-r--r--llvm/lib/Target/AArch64/AArch64InstrInfo.cpp7
-rw-r--r--llvm/tools/obj2yaml/elf2yaml.cpp2
2 files changed, 4 insertions, 5 deletions
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