[llvm] r214121 - IR: Expose Module::rbegin() and rend()

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Jul 28 14:09:32 PDT 2014


Author: dexonsmith
Date: Mon Jul 28 16:09:32 2014
New Revision: 214121

URL: http://llvm.org/viewvc/llvm-project?rev=214121&view=rev
Log:
IR: Expose Module::rbegin() and rend()

A follow-up commit for PR5680 needs to visit functions in reverse order.
Expose iterators to allow that.

Modified:
    llvm/trunk/include/llvm/IR/Module.h

Modified: llvm/trunk/include/llvm/IR/Module.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Module.h?rev=214121&r1=214120&r2=214121&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Module.h (original)
+++ llvm/trunk/include/llvm/IR/Module.h Mon Jul 28 16:09:32 2014
@@ -137,6 +137,11 @@ public:
   /// The Function constant iterator
   typedef FunctionListType::const_iterator               const_iterator;
 
+  /// The Function reverse iterator.
+  typedef FunctionListType::reverse_iterator             reverse_iterator;
+  /// The Function constant reverse iterator.
+  typedef FunctionListType::const_reverse_iterator const_reverse_iterator;
+
   /// The Global Alias iterators.
   typedef AliasListType::iterator                        alias_iterator;
   /// The Global Alias constant iterator
@@ -546,6 +551,10 @@ public:
   const_iterator          begin() const { return FunctionList.begin(); }
   iterator                end  ()       { return FunctionList.end();   }
   const_iterator          end  () const { return FunctionList.end();   }
+  reverse_iterator        rbegin()      { return FunctionList.rbegin(); }
+  const_reverse_iterator  rbegin() const{ return FunctionList.rbegin(); }
+  reverse_iterator        rend()        { return FunctionList.rend(); }
+  const_reverse_iterator  rend() const  { return FunctionList.rend(); }
   size_t                  size() const  { return FunctionList.size(); }
   bool                    empty() const { return FunctionList.empty(); }
 





More information about the llvm-commits mailing list