diff --git a/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h index 0360174c5231e..1c6c96678b5d2 100644 --- a/llvm/include/llvm/ADT/StringRef.h +++ b/llvm/include/llvm/ADT/StringRef.h @@ -258,6 +258,11 @@ namespace llvm { return Length >= Prefix.Length && compareMemory(Data, Prefix.Data, Prefix.Length) == 0; } + [[nodiscard]] LLVM_DEPRECATED( + "Use starts_with instead", + "starts_with") bool startswith(StringRef Prefix) const { + return starts_with(Prefix); + } /// Check if this string starts with the given \p Prefix, ignoring case. [[nodiscard]] bool starts_with_insensitive(StringRef Prefix) const; @@ -268,6 +273,11 @@ namespace llvm { compareMemory(end() - Suffix.Length, Suffix.Data, Suffix.Length) == 0; } + [[nodiscard]] LLVM_DEPRECATED( + "Use ends_with instead", + "ends_with") bool endswith(StringRef Suffix) const { + return ends_with(Suffix); + } /// Check if this string ends with the given \p Suffix, ignoring case. [[nodiscard]] bool ends_with_insensitive(StringRef Suffix) const;