Add interator interface to DAGInit also

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46250 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2008-01-22 11:00:07 +00:00
parent 7e857201f3
commit 7674b9d297

View File

@ -898,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(); }
};
//===----------------------------------------------------------------------===//