projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e15192b
)
Add StringRef::endswith
author
Daniel Dunbar
<daniel@zuster.org>
Wed, 5 Aug 2009 15:48:26 +0000
(15:48 +0000)
committer
Daniel Dunbar
<daniel@zuster.org>
Wed, 5 Aug 2009 15:48:26 +0000
(15:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78197
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/StringRef.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/StringRef.h
b/include/llvm/ADT/StringRef.h
index 0b1bfb28c239562fde52e814d2f9029efb383a13..e771cd0edd5b04df48ec8cc11bc252bae4d9286e 100644
(file)
--- a/
include/llvm/ADT/StringRef.h
+++ b/
include/llvm/ADT/StringRef.h
@@
-174,6
+174,11
@@
namespace llvm {
return substr(0, Prefix.Length).equals(Prefix);
}
+ /// endswith - Check if this string ends with the given \arg Suffix.
+ bool endswith(const StringRef &Suffix) const {
+ return slice(size() - Suffix.Length, size()).equals(Suffix);
+ }
+
/// @}
};