Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions llvm/include/llvm/ADT/StringRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down