Skip to content

[llvm] Use llvm::any_of (NFC) #104443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1533,9 +1533,9 @@ LineCoverageStats::LineCoverageStats(

// if there is any starting segment at this line with a counter, it must be
// mapped
Mapped |= std::any_of(
LineSegments.begin(), LineSegments.end(),
[](const auto *Seq) { return Seq->IsRegionEntry && Seq->HasCount; });
Mapped |= any_of(LineSegments, [](const auto *Seq) {
return Seq->IsRegionEntry && Seq->HasCount;
});

if (!Mapped) {
return;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9074,8 +9074,8 @@ AArch64InstrInfo::getOutliningCandidateInfo(
// link register.
outliner::Candidate &FirstCand = RepeatedSequenceLocs[0];
bool ModStackToSaveLR = false;
if (std::any_of(FirstCand.begin(), std::prev(FirstCand.end()),
[](const MachineInstr &MI) { return MI.isCall(); }))
if (any_of(drop_end(FirstCand),
[](const MachineInstr &MI) { return MI.isCall(); }))
ModStackToSaveLR = true;

// Handle the last instruction separately. If this is a tail call, then the
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6074,8 +6074,8 @@ ARMBaseInstrInfo::getOutliningCandidateInfo(
// check if the range contains a call. These require a save + restore of
// the link register.
outliner::Candidate &FirstCand = RepeatedSequenceLocs[0];
if (std::any_of(FirstCand.begin(), std::prev(FirstCand.end()),
[](const MachineInstr &MI) { return MI.isCall(); }))
if (any_of(drop_end(FirstCand),
[](const MachineInstr &MI) { return MI.isCall(); }))
NumBytesToCreateFrame += Costs.SaveRestoreLROnStack;

// Handle the last instruction separately. If it is tail call, then the
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13090,9 +13090,9 @@ bool ARMAsmParser::isMnemonicVPTPredicable(StringRef Mnemonic,
"vshrn", "vsli", "vsri", "vstrb", "vstrd",
"vstrw", "vsub"};

return std::any_of(
std::begin(predicable_prefixes), std::end(predicable_prefixes),
[&Mnemonic](const char *prefix) { return Mnemonic.starts_with(prefix); });
return any_of(predicable_prefixes, [&Mnemonic](const char *prefix) {
return Mnemonic.starts_with(prefix);
});
}

std::unique_ptr<ARMOperand> ARMAsmParser::defaultCondCodeOp() {
Expand Down
Loading