aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-11-08 14:44:25 -0800
committerGitHub <noreply@github.com>2025-11-08 14:44:25 -0800
commite61a51d0d620bf013173930749d760ad6cb788ed (patch)
treea1b5e70fbc439ea1256ab9176bfe3f94a34861a4 /llvm/lib
parent3b219cf42ac4970fc01a4e9d4b428d9689e13f78 (diff)
downloadllvm-e61a51d0d620bf013173930749d760ad6cb788ed.zip
llvm-e61a51d0d620bf013173930749d760ad6cb788ed.tar.gz
llvm-e61a51d0d620bf013173930749d760ad6cb788ed.tar.bz2
[llvm] Use llvm::find_if and llvm::is_contained (NFC) (#167166)
Identified with llvm-use-ranges.
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp9
-rw-r--r--llvm/lib/Option/OptTable.cpp5
2 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index 5ab80e33..693454e 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
@@ -917,11 +917,10 @@ unsigned DWARFVerifier::verifyDebugInfoAttribute(const DWARFDie &Die,
}
// Check if the offset matches any of the sequence offset.
- auto It =
- std::find_if(LineTable->Sequences.begin(), LineTable->Sequences.end(),
- [SectionOffset](const auto &Sequence) {
- return Sequence.StmtSeqOffset == *SectionOffset;
- });
+ auto It = llvm::find_if(LineTable->Sequences,
+ [SectionOffset](const auto &Sequence) {
+ return Sequence.StmtSeqOffset == *SectionOffset;
+ });
if (It == LineTable->Sequences.end())
ReportError(
diff --git a/llvm/lib/Option/OptTable.cpp b/llvm/lib/Option/OptTable.cpp
index 14e3b0d..0450b2f 100644
--- a/llvm/lib/Option/OptTable.cpp
+++ b/llvm/lib/Option/OptTable.cpp
@@ -756,9 +756,8 @@ void OptTable::internalPrintHelp(
// pairs.
std::map<std::string, std::vector<OptionInfo>> GroupedOptionHelp;
- auto ActiveSubCommand =
- std::find_if(SubCommands.begin(), SubCommands.end(),
- [&](const auto &C) { return SubCommand == C.Name; });
+ auto ActiveSubCommand = llvm::find_if(
+ SubCommands, [&](const auto &C) { return SubCommand == C.Name; });
if (!SubCommand.empty()) {
assert(ActiveSubCommand != SubCommands.end() &&
"Not a valid registered subcommand.");