Use any_of (NFC)

This commit is contained in:
Kazu Hirata 2022-07-24 14:48:11 -07:00
parent bafeb63448
commit 9e88cbcc40
5 changed files with 10 additions and 10 deletions

View File

@ -84,11 +84,11 @@ bool EditedSource::canInsertInOffset(SourceLocation OrigLoc, FileOffset Offs) {
deconstructMacroArgLoc(OrigLoc, ExpLoc, ArgUse);
auto I = ExpansionToArgMap.find(ExpLoc);
if (I != ExpansionToArgMap.end() &&
find_if(I->second, [&](const MacroArgUse &U) {
llvm::any_of(I->second, [&](const MacroArgUse &U) {
return ArgUse.Identifier == U.Identifier &&
std::tie(ArgUse.ImmediateExpansionLoc, ArgUse.UseLoc) !=
std::tie(U.ImmediateExpansionLoc, U.UseLoc);
}) != I->second.end()) {
})) {
// Trying to write in a macro argument input that has already been
// written by a previous commit for another expansion of the same macro
// argument name. For example:

View File

@ -182,7 +182,7 @@ public:
return false;
};
if (std::any_of(RD->field_begin(), RD->field_end(), IsTrickyField))
if (llvm::any_of(RD->fields(), IsTrickyField))
return true;
return false;
}

View File

@ -2200,8 +2200,7 @@ static int showInstrProfile(const std::string &Filename, bool ShowCounts,
Builder.addRecord(Func);
if (ShowCovered) {
if (std::any_of(Func.Counts.begin(), Func.Counts.end(),
[](uint64_t C) { return C; }))
if (llvm::any_of(Func.Counts, [](uint64_t C) { return C; }))
OS << Func.Name << "\n";
continue;
}

View File

@ -232,10 +232,11 @@ Error GraphRenderer::accountRecord(const XRayRecord &Record) {
if (!DeduceSiblingCalls)
return make_error<StringError>("No matching ENTRY record",
make_error_code(errc::invalid_argument));
auto Parent = std::find_if(
ThreadStack.rbegin(), ThreadStack.rend(),
[&](const FunctionAttr &A) { return A.FuncId == Record.FuncId; });
if (Parent == ThreadStack.rend())
bool FoundParent =
llvm::any_of(llvm::reverse(ThreadStack), [&](const FunctionAttr &A) {
return A.FuncId == Record.FuncId;
});
if (!FoundParent)
return make_error<StringError>(
"No matching Entry record in stack",
make_error_code(errc::invalid_argument)); // There is no matching

View File

@ -182,7 +182,7 @@ LogicalResult transform::TransformState::checkAndRecordHandleInvalidation(
return isa<MemoryEffects::Free>(effect.getEffect()) &&
effect.getValue() == target.get();
};
if (llvm::find_if(effects, consumesTarget) != effects.end())
if (llvm::any_of(effects, consumesTarget))
recordHandleInvalidation(target);
}
return success();