Skip to content
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
8 changes: 3 additions & 5 deletions llvm/include/llvm/Option/OptTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,13 @@ class LLVM_ABI OptTable {
StringRef SubCommand) const {
assert(!SubCommand.empty() &&
"This helper is only for valid registered subcommands.");
auto SCIT =
std::find_if(SubCommands.begin(), SubCommands.end(),
[&](const auto &C) { return SubCommand == C.Name; });
auto SCIT = llvm::find_if(
SubCommands, [&](const auto &C) { return SubCommand == C.Name; });
assert(SCIT != SubCommands.end() &&
"This helper is only for valid registered subcommands.");
auto SubCommandIDs = CandidateInfo->getSubCommandIDs(SubCommandIDsTable);
unsigned CurrentSubCommandID = SCIT - &SubCommands[0];
return std::find(SubCommandIDs.begin(), SubCommandIDs.end(),
CurrentSubCommandID) != SubCommandIDs.end();
return llvm::is_contained(SubCommandIDs, CurrentSubCommandID);
}

private:
Expand Down
9 changes: 4 additions & 5 deletions llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/Option/OptTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
5 changes: 2 additions & 3 deletions llvm/unittests/Transforms/Utils/SSAUpdaterBulkTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,8 @@ static void RunEliminateNewDuplicatePHINode(
}

Function *F = M->getFunction("main");
auto BBIt = std::find_if(F->begin(), F->end(), [](const BasicBlock &Block) {
return Block.getName() == "testbb";
});
auto BBIt = llvm::find_if(
*F, [](const BasicBlock &Block) { return Block.getName() == "testbb"; });
ASSERT_NE(BBIt, F->end());
Check(*BBIt, EliminateNewDuplicatePHINodes);
}
Expand Down
6 changes: 3 additions & 3 deletions llvm/utils/TableGen/OptionParserEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,9 @@ static void emitOptionParser(const RecordKeeper &Records, raw_ostream &OS) {
assert((CurIndex == 0 || !SubCommand.empty()) &&
"Only first subcommand set should be empty!");
for (const auto &SubCommandKey : SubCommand) {
auto It = std::find_if(
SubCommands.begin(), SubCommands.end(),
[&](const Record *R) { return R->getName() == SubCommandKey; });
auto It = llvm::find_if(SubCommands, [&](const Record *R) {
return R->getName() == SubCommandKey;
});
assert(It != SubCommands.end() && "SubCommand not found");
OS << ", " << std::distance(SubCommands.begin(), It) << " /* '"
<< SubCommandKey << "' */";
Expand Down