https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/198070
None >From 9c96578aad809f11073e2bd6c31aecd6f6ebb9fe Mon Sep 17 00:00:00 2001 From: Paul Kirth <[email protected]> Date: Sat, 16 May 2026 01:45:17 +0000 Subject: [PATCH] [clang-doc][nfc] Prefer range based APIs --- clang-tools-extra/clang-doc/Representation.cpp | 4 ++-- clang-tools-extra/clang-doc/YAMLGenerator.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/clang-tools-extra/clang-doc/Representation.cpp b/clang-tools-extra/clang-doc/Representation.cpp index 738c8b6559eb6..a23290b243f4b 100644 --- a/clang-tools-extra/clang-doc/Representation.cpp +++ b/clang-tools-extra/clang-doc/Representation.cpp @@ -20,6 +20,7 @@ // //===----------------------------------------------------------------------===// #include "Representation.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringMap.h" #include "llvm/Support/Error.h" #include "llvm/Support/Path.h" @@ -309,8 +310,7 @@ bool CommentInfo::operator==(const CommentInfo &Other) const { if (FirstCI != SecondCI || Children.size() != Other.Children.size()) return false; - return std::equal(Children.begin(), Children.end(), Other.Children.begin(), - Other.Children.end()); + return llvm::equal(Children, Other.Children); } bool CommentInfo::operator<(const CommentInfo &Other) const { diff --git a/clang-tools-extra/clang-doc/YAMLGenerator.cpp b/clang-tools-extra/clang-doc/YAMLGenerator.cpp index d08c695fd9756..da48126a4bf0d 100644 --- a/clang-tools-extra/clang-doc/YAMLGenerator.cpp +++ b/clang-tools-extra/clang-doc/YAMLGenerator.cpp @@ -10,6 +10,7 @@ #include "Generators.h" #include "Representation.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Support/YAMLTraits.h" #include "llvm/Support/raw_ostream.h" #include <optional> @@ -187,7 +188,7 @@ template <> struct ScalarTraits<SymbolID> { static SymbolID stringToSymbol(llvm::StringRef Value) { SymbolID USR; std::string HexString = fromHex(Value); - std::copy(HexString.begin(), HexString.end(), USR.begin()); + llvm::copy(HexString, USR.begin()); return SymbolID(USR); } _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
