[llvm] [NFC][LLVM][StringRef] Remove function names from header comments (PR #195463)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Sat May 2 08:32:36 PDT 2026


https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/195463

None

>From 986d28f734ba4e0acc15e527dbaa32c61428f1f6 Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Sat, 2 May 2026 08:31:35 -0700
Subject: [PATCH] [NFC][LLVM][StringRef] Remove function names from header
 comments

---
 llvm/include/llvm/ADT/StringRef.h | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h
index 1a2f2799fe960..08df288f6626d 100644
--- a/llvm/include/llvm/ADT/StringRef.h
+++ b/llvm/include/llvm/ADT/StringRef.h
@@ -132,29 +132,29 @@ class LLVM_GSL_POINTER StringRef {
   /// @name String Operations
   /// @{
 
-  /// data - Get a pointer to the start of the string (which may not be null
+  /// Get a pointer to the start of the string (which may not be null
   /// terminated).
   [[nodiscard]] constexpr const char *data() const { return Data; }
 
-  /// empty - Check if the string is empty.
+  /// Check if the string is empty.
   [[nodiscard]] constexpr bool empty() const { return size() == 0; }
 
-  /// size - Get the string size.
+  /// Get the string size.
   [[nodiscard]] constexpr size_t size() const { return Length; }
 
-  /// front - Get the first character in the string.
+  /// Get the first character in the string.
   [[nodiscard]] char front() const {
     assert(!empty());
     return data()[0];
   }
 
-  /// back - Get the last character in the string.
+  /// Get the last character in the string.
   [[nodiscard]] char back() const {
     assert(!empty());
     return data()[size() - 1];
   }
 
-  // copy - Allocate copy in Allocator and return StringRef to it.
+  // Allocate copy in Allocator and return StringRef to it.
   template <typename Allocator>
   [[nodiscard]] StringRef copy(Allocator &A) const {
     // Don't request a length 0 copy from the allocator.
@@ -170,9 +170,9 @@ class LLVM_GSL_POINTER StringRef {
     return size() == RHS.size() && compare_insensitive(RHS) == 0;
   }
 
-  /// compare - Compare two strings; the result is negative, zero, or positive
-  /// if this string is lexicographically less than, equal to, or greater than
-  /// the \p RHS.
+  /// Compare two strings; the result is negative, zero, or positive if this
+  /// string is lexicographically less than, equal to, or greater than the
+  /// \p RHS.
   [[nodiscard]] int compare(StringRef RHS) const {
     // Check the prefix for a mismatch.
     if (int Res =
@@ -188,8 +188,7 @@ class LLVM_GSL_POINTER StringRef {
   /// Compare two strings, ignoring case.
   [[nodiscard]] LLVM_ABI int compare_insensitive(StringRef RHS) const;
 
-  /// compare_numeric - Compare two strings, treating sequences of digits as
-  /// numbers.
+  /// Compare two strings, treating sequences of digits as numbers.
   [[nodiscard]] LLVM_ABI int compare_numeric(StringRef RHS) const;
 
   /// Determine the edit distance between this string and another
@@ -218,7 +217,7 @@ class LLVM_GSL_POINTER StringRef {
   edit_distance_insensitive(StringRef Other, bool AllowReplacements = true,
                             unsigned MaxEditDistance = 0) const;
 
-  /// str - Get the contents as an std::string.
+  /// Get the contents as an std::string.
   [[nodiscard]] std::string str() const {
     if (!data())
       return std::string();



More information about the llvm-commits mailing list