From 827de0520ee986fcda5f0d3290a3746249fa5847 Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Fri, 25 Jan 2013 06:33:52 +0000 Subject: [PATCH] ArrayRef reverse iterators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173424 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/ArrayRef.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/llvm/ADT/ArrayRef.h b/include/llvm/ADT/ArrayRef.h index a707a0d4fdb..c555c1c2b1d 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 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; }