From f3813b1d76d1f23f2ae7fbc0b38f33d849bd1352 Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Tue, 22 Jan 2008 11:00:07 +0000 Subject: [PATCH] Add interator interface to DAGInit also llvm-svn: 46250 --- utils/TableGen/Record.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h index 2e2e46c8445..5f0e4c7fa67 100644 --- a/utils/TableGen/Record.h +++ b/utils/TableGen/Record.h @@ -898,6 +898,28 @@ public: virtual Init *resolveReferences(Record &R, const RecordVal *RV); virtual std::string getAsString() const; + + typedef std::vector::iterator arg_iterator; + typedef std::vector::const_iterator const_arg_iterator; + typedef std::vector::iterator name_iterator; + typedef std::vector::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(); } + }; //===----------------------------------------------------------------------===//