aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/tools/llvm-tapi-diff/DiffEngine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/tools/llvm-tapi-diff/DiffEngine.cpp')
-rw-r--r--contrib/llvm-project/llvm/tools/llvm-tapi-diff/DiffEngine.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/contrib/llvm-project/llvm/tools/llvm-tapi-diff/DiffEngine.cpp b/contrib/llvm-project/llvm/tools/llvm-tapi-diff/DiffEngine.cpp
index 45a1f78525a7..9ebaadbeec26 100644
--- a/contrib/llvm-project/llvm/tools/llvm-tapi-diff/DiffEngine.cpp
+++ b/contrib/llvm-project/llvm/tools/llvm-tapi-diff/DiffEngine.cpp
@@ -235,12 +235,11 @@ void findAndAddDiff(const std::vector<InterfaceFileRef> &CollectedIRefVec,
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 FoundTarg = llvm::find(LIRef.targets(), Targ);
- return (FoundTarg != LIRef.targets().end() &&
- IRef.getInstallName() == LIRef.getInstallName());
+ 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);
@@ -267,14 +266,13 @@ void findAndAddDiff(InterfaceFile::const_symbol_range CollectedSyms,
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) {
- auto FoundTarg = llvm::find(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() &&
- FoundTarg != LSym->targets().end());
+ llvm::is_contained(LSym->targets(), Targ));
});
- if (FoundSym == LookupSyms.end())
+ if (!FoundSym)
addDiffForTargSlice<DiffSymVec, SymScalar>(Sym, Targ, Result, Order);
}
}
@@ -410,10 +408,10 @@ DiffEngine::findDifferences(const InterfaceFile *IFLHS,
}
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))));
}