aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-12-10 18:46:12 +0000
committerBill Wendling <isanbard@gmail.com>2013-12-10 18:46:12 +0000
commit90b81731c1a9bc126d0b29321b3513c9b85f8414 (patch)
tree8f8298d9270b95ac0f6589540f5a7461487e36d4 /include
parentb1eb9dd018475d45d9a8f705441f8f6c86a8f986 (diff)
downloadexternal_llvm-90b81731c1a9bc126d0b29321b3513c9b85f8414.zip
external_llvm-90b81731c1a9bc126d0b29321b3513c9b85f8414.tar.gz
external_llvm-90b81731c1a9bc126d0b29321b3513c9b85f8414.tar.bz2
Merging r196768:
------------------------------------------------------------------------ r196768 | majnemer | 2013-12-09 01:04:00 -0800 (Mon, 09 Dec 2013) | 5 lines 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/branches/release_34@196945 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/ArrayRef.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/ADT/ArrayRef.h b/include/llvm/ADT/ArrayRef.h
index 61467e9..e5562c3 100644
--- a/include/llvm/ADT/ArrayRef.h
+++ b/include/llvm/ADT/ArrayRef.h
@@ -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());