Skip to content

Commit 637299e

Browse files
[clang] Use llvm::equal (NFC) (llvm#169172)
Identified with llvm-use-ranges.
1 parent 9de880e commit 637299e

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -852,10 +852,9 @@ static bool RoundTrip(ParseFn Parse, GenerateFn Generate,
852852
// Compares two lists of arguments.
853853
auto Equal = [](const ArrayRef<const char *> A,
854854
const ArrayRef<const char *> B) {
855-
return std::equal(A.begin(), A.end(), B.begin(), B.end(),
856-
[](const char *AElem, const char *BElem) {
857-
return StringRef(AElem) == StringRef(BElem);
858-
});
855+
return llvm::equal(A, B, [](const char *AElem, const char *BElem) {
856+
return StringRef(AElem) == StringRef(BElem);
857+
});
859858
};
860859

861860
// If we generated different arguments from what we assume are two

clang/utils/TableGen/NeonEmitter.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,13 +2233,10 @@ NeonEmitter::areRangeChecksCompatible(const ArrayRef<ImmCheck> ChecksA,
22332233
// the same. The element types may differ as they will be resolved
22342234
// per-intrinsic as overloaded types by SemaArm.cpp, though the vector sizes
22352235
// are not and so must be the same.
2236-
bool compat =
2237-
std::equal(ChecksA.begin(), ChecksA.end(), ChecksB.begin(), ChecksB.end(),
2238-
[](const auto &A, const auto &B) {
2239-
return A.getImmArgIdx() == B.getImmArgIdx() &&
2240-
A.getKind() == B.getKind() &&
2241-
A.getVecSizeInBits() == B.getVecSizeInBits();
2242-
});
2236+
bool compat = llvm::equal(ChecksA, ChecksB, [](const auto &A, const auto &B) {
2237+
return A.getImmArgIdx() == B.getImmArgIdx() && A.getKind() == B.getKind() &&
2238+
A.getVecSizeInBits() == B.getVecSizeInBits();
2239+
});
22432240

22442241
return compat;
22452242
}

0 commit comments

Comments
 (0)