llvm.org GIT mirror llvm / e36df3f
add a simple back() method to StringRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78544 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
1 changed file(s) with 5 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
7575
7676 /// size - Get the string size.
7777 size_t size() const { return Length; }
78
79 char back() const {
80 assert(!empty());
81 return Data[Length-1];
82 }
7883
7984 /// equals - Check for string equality, this is more efficient than
8085 /// compare() in when the relative ordering of inequal strings isn't needed.