Provide iterator access to ListInit contents
authorAnton Korobeynikov <asl@math.spbu.ru>
Mon, 21 Jan 2008 22:30:26 +0000 (22:30 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Mon, 21 Jan 2008 22:30:26 +0000 (22:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46223 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/Record.h

index aa4a69540b0548169235a8e82de43c6a9bcebca2..2e2e46c8445a41f70084ff6febede12ed4c5f592 100644 (file)
@@ -643,6 +643,17 @@ public:
   virtual Init *resolveReferences(Record &R, const RecordVal *RV);
 
   virtual std::string getAsString() const;
+
+  typedef std::vector<Init*>::iterator       iterator;
+  typedef std::vector<Init*>::const_iterator const_iterator;
+
+  inline iterator       begin()       { return Values.begin(); }
+  inline const_iterator begin() const { return Values.begin(); }
+  inline iterator       end  ()       { return Values.end();   }
+  inline const_iterator end  () const { return Values.end();   }
+
+  inline size_t         size () const { return Values.size();  }
+  inline bool           empty() const { return Values.empty(); }
 };
 
 /// BinOpInit - !op (X, Y) - Combine two inits.