From 9f08894a066c3f0f25d11c1da622a62ef9d7790b Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Mon, 9 Dec 2013 09:04:00 +0000 Subject: [PATCH] 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 --- 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 61467e9b21c..e5562c36830 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 reverse_iterator; + /// Construct an empty MutableArrayRef. /*implicit*/ MutableArrayRef() : ArrayRef() {} @@ -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());