Skip to content

Commit cbac2a9

Browse files
[llvm] Use llvm::is_contained (NFC) (#140742)
1 parent 04ad8d4 commit cbac2a9

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,8 +1123,7 @@ template <typename C, typename H> bool ConstructDecompositionT<C, H>::split() {
11231123
bool success = true;
11241124

11251125
auto isImplicit = [this](const ClauseTy *node) {
1126-
return llvm::any_of(
1127-
implicit, [node](const ClauseTy &clause) { return &clause == node; });
1126+
return llvm::is_contained(llvm::make_pointer_range(implicit), node);
11281127
};
11291128

11301129
for (llvm::omp::Directive leaf :

llvm/lib/Support/ThreadPool.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ bool StdThreadPool::workCompletedUnlocked(ThreadPoolTaskGroup *Group) const {
137137
if (Group == nullptr)
138138
return !ActiveThreads && Tasks.empty();
139139
return ActiveGroups.count(Group) == 0 &&
140-
!llvm::any_of(Tasks,
141-
[Group](const auto &T) { return T.second == Group; });
140+
!llvm::is_contained(llvm::make_second_range(Tasks), Group);
142141
}
143142

144143
void StdThreadPool::wait() {

llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,7 @@ bool AMDGPURewriteOutArguments::runOnFunction(Function &F) {
274274
Value *ReplVal = Store.second->getValueOperand();
275275

276276
auto &ValVec = Replacements[Store.first];
277-
if (llvm::any_of(ValVec,
278-
[OutArg](const std::pair<Argument *, Value *> &Entry) {
279-
return Entry.first == OutArg;
280-
})) {
277+
if (llvm::is_contained(llvm::make_first_range(ValVec), OutArg)) {
281278
LLVM_DEBUG(dbgs()
282279
<< "Saw multiple out arg stores" << *OutArg << '\n');
283280
// It is possible to see stores to the same argument multiple times,

llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ class TypeIndexIteratorTest : public testing::Test {
9696
ArrayRef<uint8_t> Loc = RecordData.drop_front(Offset);
9797
ArrayRef<TypeIndex> Indices(
9898
reinterpret_cast<const TypeIndex *>(Loc.data()), Ref.Count);
99-
if (llvm::any_of(Indices,
100-
[TI](const TypeIndex &Other) { return Other == TI; }))
99+
if (llvm::is_contained(Indices, TI))
101100
return true;
102101
}
103102
return false;

0 commit comments

Comments
 (0)