ADT: Implement MutableArrayRef::reverse_iterator

This adds rbegin/rend methods to MutableArrayRef, they will be used by a
follow-on commit in clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196768 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2013-12-09 09:04:00 +00:00
parent 847b5d976d
commit 4062ed8762

View File

@ -185,6 +185,8 @@ namespace llvm {
public:
typedef T *iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
/// Construct an empty MutableArrayRef.
/*implicit*/ MutableArrayRef() : ArrayRef<T>() {}
@ -219,6 +221,9 @@ namespace llvm {
iterator begin() const { return data(); }
iterator end() const { return data() + this->size(); }
reverse_iterator rbegin() const { return reverse_iterator(end()); }
reverse_iterator rend() const { return reverse_iterator(begin()); }
/// front - Get the first element.
T &front() const {
assert(!this->empty());