mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-18 17:55:18 +00:00
ADT: Implement MutableArrayRef::reverse_iterator
This adds rbegin/rend methods to MutableArrayRef, they will be used by a follow-on commit in clang. llvm-svn: 196768
This commit is contained in:
parent
700f24667b
commit
9f08894a06
@ -185,6 +185,8 @@ namespace llvm {
|
|||||||
public:
|
public:
|
||||||
typedef T *iterator;
|
typedef T *iterator;
|
||||||
|
|
||||||
|
typedef std::reverse_iterator<iterator> reverse_iterator;
|
||||||
|
|
||||||
/// Construct an empty MutableArrayRef.
|
/// Construct an empty MutableArrayRef.
|
||||||
/*implicit*/ MutableArrayRef() : ArrayRef<T>() {}
|
/*implicit*/ MutableArrayRef() : ArrayRef<T>() {}
|
||||||
|
|
||||||
@ -219,6 +221,9 @@ namespace llvm {
|
|||||||
iterator begin() const { return data(); }
|
iterator begin() const { return data(); }
|
||||||
iterator end() const { return data() + this->size(); }
|
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.
|
/// front - Get the first element.
|
||||||
T &front() const {
|
T &front() const {
|
||||||
assert(!this->empty());
|
assert(!this->empty());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user