Dwarf requires variable entries to be in the source order. Right now, since we are...
[oota-llvm.git] / utils / TableGen / Record.h
index a7210674e722abc3156397a82bca6a6f4ee4752c..5f0e4c7fa679933e1eec81a36f91463847b2e947 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -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.
@@ -887,6 +898,28 @@ public:
   virtual Init *resolveReferences(Record &R, const RecordVal *RV);
 
   virtual std::string getAsString() const;
+
+  typedef std::vector<Init*>::iterator             arg_iterator;
+  typedef std::vector<Init*>::const_iterator       const_arg_iterator;
+  typedef std::vector<std::string>::iterator       name_iterator;
+  typedef std::vector<std::string>::const_iterator const_name_iterator;
+
+  inline arg_iterator        arg_begin()       { return Args.begin(); }
+  inline const_arg_iterator  arg_begin() const { return Args.begin(); }
+  inline arg_iterator        arg_end  ()       { return Args.end();   }
+  inline const_arg_iterator  arg_end  () const { return Args.end();   }
+
+  inline size_t              arg_size () const { return Args.size();  }
+  inline bool                arg_empty() const { return Args.empty(); }
+
+  inline name_iterator       name_begin()       { return ArgNames.begin(); }
+  inline const_name_iterator name_begin() const { return ArgNames.begin(); }
+  inline name_iterator       name_end  ()       { return ArgNames.end();   }
+  inline const_name_iterator name_end  () const { return ArgNames.end();   }
+
+  inline size_t              name_size () const { return ArgNames.size();  }
+  inline bool                name_empty() const { return ArgNames.empty(); }
+
 };
 
 //===----------------------------------------------------------------------===//