[llvm] [ADT] Remove StringRef::equals (PR #98735)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 13 03:12:59 PDT 2024


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/98735

StringRef::equals has been deprecated since:

  commit de483ad513895c0adf7f21c7001c30f031998ea3
  Author: Kazu Hirata <kazu at google.com>
  Date:   Thu May 16 00:38:37 2024 -0700


>From 6b0f48f274a5dd420e5c4d6fa9c7f4f8bb975b15 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 16 May 2024 00:41:28 -0700
Subject: [PATCH] [ADT] Remove StringRef::equals

StringRef::equals has been deprecated since:

  commit de483ad513895c0adf7f21c7001c30f031998ea3
  Author: Kazu Hirata <kazu at google.com>
  Date:   Thu May 16 00:38:37 2024 -0700
---
 llvm/include/llvm/ADT/StringRef.h | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h
index 2120c04530b23..049f22b03e46e 100644
--- a/llvm/include/llvm/ADT/StringRef.h
+++ b/llvm/include/llvm/ADT/StringRef.h
@@ -159,14 +159,6 @@ namespace llvm {
       return StringRef(S, Length);
     }
 
-    /// equals - Check for string equality, this is more efficient than
-    /// compare() when the relative ordering of inequal strings isn't needed.
-    [[nodiscard]] LLVM_DEPRECATED("Use == instead",
-                                  "==") bool equals(StringRef RHS) const {
-      return (Length == RHS.Length &&
-              compareMemory(Data, RHS.Data, RHS.Length) == 0);
-    }
-
     /// Check for string equality, ignoring case.
     [[nodiscard]] bool equals_insensitive(StringRef RHS) const {
       return Length == RHS.Length && compare_insensitive(RHS) == 0;



More information about the llvm-commits mailing list