@@ -21,55 +21,6 @@ index d9087dd1c516..2f38555d9793 100644
2121 inline T get() const {
2222 assert(isa<T>(*this) && "Invalid accessor called");
2323 return cast<T>(*this);
24- diff --git a/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h
25- index 09c6d6d6eab0..ea8ed00727be 100644
26- --- a/llvm/include/llvm/ADT/StringRef.h
27- +++ b/llvm/include/llvm/ADT/StringRef.h
28- @@ -168,6 +168,14 @@ namespace llvm {
29- return StringRef(S, size());
30- }
31-
32- + [[nodiscard]] bool equals(StringRef RHS) const {
33- + if (size() != RHS.size())
34- + return false;
35- + if (empty())
36- + return true;
37- + return ::memcmp(data(), RHS.data(), size()) == 0;
38- + }
39- +
40- /// Check for string equality, ignoring case.
41- [[nodiscard]] bool equals_insensitive(StringRef RHS) const {
42- return size() == RHS.size() && compare_insensitive(RHS) == 0;
43- @@ -265,6 +273,13 @@ namespace llvm {
44- [[nodiscard]] bool starts_with(char Prefix) const {
45- return !empty() && front() == Prefix;
46- }
47- + [[nodiscard]] bool startswith(StringRef Prefix) const {
48- + return size() >= Prefix.size() &&
49- + compareMemory(data(), Prefix.data(), Prefix.size()) == 0;
50- + }
51- + [[nodiscard]] bool startswith(char Prefix) const {
52- + return !empty() && front() == Prefix;
53- + }
54-
55- /// Check if this string starts with the given \p Prefix, ignoring case.
56- [[nodiscard]] LLVM_ABI bool starts_with_insensitive(StringRef Prefix) const;
57- @@ -278,6 +293,15 @@ namespace llvm {
58- [[nodiscard]] bool ends_with(char Suffix) const {
59- return !empty() && back() == Suffix;
60- }
61- + /// Check if this string ends with the given \p Suffix.
62- + [[nodiscard]] bool endswith(StringRef Suffix) const {
63- + return size() >= Suffix.size() &&
64- + compareMemory(end() - Suffix.size(), Suffix.data(),
65- + Suffix.size()) == 0;
66- + }
67- + [[nodiscard]] bool endswith(char Suffix) const {
68- + return !empty() && back() == Suffix;
69- + }
70-
71- /// Check if this string ends with the given \p Suffix, ignoring case.
72- [[nodiscard]] LLVM_ABI bool ends_with_insensitive(StringRef Suffix) const;
7324diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.h b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
7425index 0f98af69f12c..28d6f730cc8c 100644
7526--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
0 commit comments