[clang] [clang] Use llvm::partition_point (NFC) (PR #141351)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sat May 24 08:23:08 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/141351
None
>From 1d24b61eff5dc9fb25a4769166374657041808a5 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Fri, 23 May 2025 22:53:30 -0700
Subject: [PATCH] [clang] Use llvm::partition_point (NFC)
---
clang/lib/Sema/SemaType.cpp | 4 ++--
clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 874e41ac0b90c..49d10f5502084 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -324,8 +324,8 @@ namespace {
// FIXME: This is quadratic if we have lots of reuses of the same
// attributed type.
- for (auto It = std::partition_point(
- AttrsForTypes.begin(), AttrsForTypes.end(),
+ for (auto It = llvm::partition_point(
+ AttrsForTypes,
[=](const TypeAttrPair &A) { return A.first < AT; });
It != AttrsForTypes.end() && It->first == AT; ++It) {
if (It->second) {
diff --git a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
index 2ab248f9aa6d9..6715ab2f30b3a 100644
--- a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
@@ -574,8 +574,8 @@ void PlistDiagnostics::printBugPath(llvm::raw_ostream &o, const FIDMap &FM,
}) &&
"PathDiagnostic is not partitioned so that notes precede the rest");
- PathPieces::const_iterator FirstNonNote = std::partition_point(
- Path.begin(), Path.end(), [](const PathDiagnosticPieceRef &E) {
+ PathPieces::const_iterator FirstNonNote =
+ llvm::partition_point(Path, [](const PathDiagnosticPieceRef &E) {
return E->getKind() == PathDiagnosticPiece::Note;
});
More information about the cfe-commits
mailing list