diff options
author | Andrew Trick <atrick@apple.com> | 2013-01-25 06:33:52 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2013-01-25 06:33:52 +0000 |
commit | 827de0520ee986fcda5f0d3290a3746249fa5847 (patch) | |
tree | ab4012778ee22bb2eb94707bf98460b93792fd70 | |
parent | 2f0a4e1aadfa227ed2565e532f0d1a3cf8e8efa5 (diff) | |
download | external_llvm-827de0520ee986fcda5f0d3290a3746249fa5847.zip external_llvm-827de0520ee986fcda5f0d3290a3746249fa5847.tar.gz external_llvm-827de0520ee986fcda5f0d3290a3746249fa5847.tar.bz2 |
ArrayRef reverse iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173424 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ADT/ArrayRef.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/ADT/ArrayRef.h b/include/llvm/ADT/ArrayRef.h index a707a0d..c555c1c 100644 --- a/include/llvm/ADT/ArrayRef.h +++ b/include/llvm/ADT/ArrayRef.h @@ -33,6 +33,8 @@ namespace llvm { typedef const T *const_iterator; typedef size_t size_type; + typedef std::reverse_iterator<iterator> reverse_iterator; + private: /// The start of the array, in an external buffer. const T *Data; @@ -84,6 +86,9 @@ namespace llvm { iterator begin() const { return Data; } iterator end() const { return Data + Length; } + reverse_iterator rbegin() const { return reverse_iterator(end()); } + reverse_iterator rend() const { return reverse_iterator(begin()); } + /// empty - Check if the array is empty. bool empty() const { return Length == 0; } |