[polly] r274276 - ScopInfo: Add array_begin() and array_end() iterators

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 13:53:50 PDT 2016


Author: grosser
Date: Thu Jun 30 15:53:50 2016
New Revision: 274276

URL: http://llvm.org/viewvc/llvm-project?rev=274276&view=rev
Log:
ScopInfo: Add array_begin() and array_end() iterators

These iterators are provided to complete the interface with non-range iterators
and are useful for external users of ScopInfo. To ensure they are tested we
use them to implement the existing range iterators.

Modified:
    polly/trunk/include/polly/ScopInfo.h

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=274276&r1=274275&r2=274276&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Thu Jun 30 15:53:50 2016
@@ -1842,15 +1842,29 @@ public:
   /// could be executed.
   bool isEmpty() const { return Stmts.empty(); }
 
+  typedef ArrayInfoMapTy::iterator array_iterator;
+  typedef ArrayInfoMapTy::const_iterator const_array_iterator;
   typedef iterator_range<ArrayInfoMapTy::iterator> array_range;
   typedef iterator_range<ArrayInfoMapTy::const_iterator> const_array_range;
 
+  inline array_iterator array_begin() { return ScopArrayInfoMap.begin(); }
+
+  inline array_iterator array_end() { return ScopArrayInfoMap.end(); }
+
+  inline const_array_iterator array_begin() const {
+    return ScopArrayInfoMap.begin();
+  }
+
+  inline const_array_iterator array_end() const {
+    return ScopArrayInfoMap.end();
+  }
+
   inline array_range arrays() {
-    return array_range(ScopArrayInfoMap.begin(), ScopArrayInfoMap.end());
+    return array_range(array_begin(), array_end());
   }
 
   inline const_array_range arrays() const {
-    return const_array_range(ScopArrayInfoMap.begin(), ScopArrayInfoMap.end());
+    return const_array_range(array_begin(), array_end());
   }
 
   /// @brief Return the isl_id that represents a certain parameter.




More information about the llvm-commits mailing list