namespace {
bool refersToReorderedSection(ErrorOr<BinarySection &> Section) {
- auto Itr =
- llvm::find_if(opts::ReorderData, [&](const std::string &SectionName) {
- return (Section && Section->getName() == SectionName);
- });
- return Itr != opts::ReorderData.end();
+ return llvm::any_of(opts::ReorderData, [&](const std::string &SectionName) {
+ return Section && Section->getName() == SectionName;
+ });
}
} // anonymous namespace
if (Parent.getCanonicalDecl() == ThisClass.getCanonicalDecl())
return true;
const CXXRecordDecl *ParentCanonicalDecl = Parent.getCanonicalDecl();
- return ThisClass.bases_end() !=
- llvm::find_if(ThisClass.bases(), [=](const CXXBaseSpecifier &Base) {
- auto *BaseDecl = Base.getType()->getAsCXXRecordDecl();
- assert(BaseDecl);
- return ParentCanonicalDecl == BaseDecl->getCanonicalDecl();
- });
+ return llvm::any_of(ThisClass.bases(), [=](const CXXBaseSpecifier &Base) {
+ auto *BaseDecl = Base.getType()->getAsCXXRecordDecl();
+ assert(BaseDecl);
+ return ParentCanonicalDecl == BaseDecl->getCanonicalDecl();
+ });
}
static BasesVector getParentsByGrandParent(const CXXRecordDecl &GrandParent,
llvm::StringRef PathExt = llvm::sys::path::extension(OriginalFile);
// Lookup in a list of known extensions.
- auto *SourceIter =
- llvm::find_if(SourceExtensions, [&PathExt](PathRef SourceExt) {
- return SourceExt.equals_insensitive(PathExt);
- });
- bool IsSource = SourceIter != std::end(SourceExtensions);
+ bool IsSource = llvm::any_of(SourceExtensions, [&PathExt](PathRef SourceExt) {
+ return SourceExt.equals_insensitive(PathExt);
+ });
- auto *HeaderIter =
- llvm::find_if(HeaderExtensions, [&PathExt](PathRef HeaderExt) {
- return HeaderExt.equals_insensitive(PathExt);
- });
- bool IsHeader = HeaderIter != std::end(HeaderExtensions);
+ bool IsHeader = llvm::any_of(HeaderExtensions, [&PathExt](PathRef HeaderExt) {
+ return HeaderExt.equals_insensitive(PathExt);
+ });
// We can only switch between the known extensions.
if (!IsSource && !IsHeader)
// downward defs.
bool needPHI =
VRegs.size() >= 1 &&
- llvm::find_if(
+ llvm::any_of(
VRegs,
[&](const std::pair<const MachineBasicBlock *, Register> &V)
- -> bool { return V.second != VRegs[0].second; }) !=
- VRegs.end();
+ -> bool { return V.second != VRegs[0].second; });
// If there is no upwards exposed used and we don't need a phi just
// forward the swifterror vreg from the predecessor(s).
APInt ExpectedElt = APInt(MaskBits, *FirstRealElt + 1);
// The following shuffle indices must be the successive elements after the
// first real element.
- const int *FirstWrongElt = std::find_if(FirstRealElt + 1, M.end(),
- [&](int Elt) {return Elt != ExpectedElt++ && Elt != -1;});
- if (FirstWrongElt != M.end())
+ bool FoundWrongElt = std::any_of(FirstRealElt + 1, M.end(), [&](int Elt) {
+ return Elt != ExpectedElt++ && Elt != -1;
+ });
+ if (FoundWrongElt)
return false;
// The index of an EXT is the first element if it is not UNDEF.
Result.Kind = AD_Str_Vec;
for (const auto &IRef : CollectedIRefVec)
for (auto Targ : IRef.targets()) {
- auto FoundIRef = llvm::find_if(LookupIRefVec, [&](const auto LIRef) {
+ auto FoundIRef = llvm::any_of(LookupIRefVec, [&](const auto LIRef) {
return llvm::is_contained(LIRef.targets(), Targ) &&
IRef.getInstallName() == LIRef.getInstallName();
});
- if (FoundIRef == LookupIRefVec.end())
+ if (!FoundIRef)
addDiffForTargSlice<DiffStrVec,
DiffScalarVal<StringRef, AD_Diff_Scalar_Str>>(
IRef.getInstallName(), Targ, Result, Order);
Result.Kind = AD_Sym_Vec;
for (const auto *Sym : CollectedSyms)
for (const auto Targ : Sym->targets()) {
- auto FoundSym = llvm::find_if(LookupSyms, [&](const auto LSym) {
- return Sym->getName() == LSym->getName() &&
- Sym->getKind() == LSym->getKind() &&
- Sym->getFlags() == LSym->getFlags() &&
- llvm::is_contained(LSym->targets(), Targ);
+ auto FoundSym = llvm::any_of(LookupSyms, [&](const auto LSym) {
+ return (Sym->getName() == LSym->getName() &&
+ Sym->getKind() == LSym->getKind() &&
+ Sym->getFlags() == LSym->getFlags() &&
+ llvm::is_contained(LSym->targets(), Targ));
});
- if (FoundSym == LookupSyms.end())
+ if (!FoundSym)
addDiffForTargSlice<DiffSymVec, SymScalar>(Sym, Targ, Result, Order);
}
}
}
for (auto DocRHS : IFRHS->documents()) {
auto WasGathered =
- llvm::find_if(DocsInserted, [&](const auto &GatheredDoc) {
+ llvm::any_of(DocsInserted, [&](const auto &GatheredDoc) {
return (GatheredDoc == DocRHS->getInstallName());
});
- if (WasGathered == DocsInserted.end())
+ if (!WasGathered)
Docs.Values.push_back(std::make_unique<InlineDoc>(InlineDoc(
DocRHS->getInstallName(), getSingleIF(DocRHS.get(), rhs))));
}