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:
c6ca847
)
add a simple back() method to StringRef.
author
Chris Lattner
<sabre@nondot.org>
Mon, 10 Aug 2009 00:44:02 +0000
(
00:44
+0000)
committer
Chris Lattner
<sabre@nondot.org>
Mon, 10 Aug 2009 00:44:02 +0000
(
00:44
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78544
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 e771cd0edd5b04df48ec8cc11bc252bae4d9286e..e24fe05e7cd342ccf17662c1f1104afb04c8c86c 100644
(file)
--- a/
include/llvm/ADT/StringRef.h
+++ b/
include/llvm/ADT/StringRef.h
@@
-76,6
+76,11
@@
namespace llvm {
/// size - Get the string size.
size_t size() const { return Length; }
+
+ char back() const {
+ assert(!empty());
+ return Data[Length-1];
+ }
/// equals - Check for string equality, this is more efficient than
/// compare() in when the relative ordering of inequal strings isn't needed.