[cfe-commits] r54526 - /cfe/trunk/include/clang/AST/Decl.h
Argiris Kirtzidis
akyrtzi at gmail.com
Fri Aug 8 06:54:24 PDT 2008
Author: akirtzidis
Date: Fri Aug 8 08:54:06 2008
New Revision: 54526
URL: http://llvm.org/viewvc/llvm-project?rev=54526&view=rev
Log:
Add iterator access to field members for RecordDecl.
Modified:
cfe/trunk/include/clang/AST/Decl.h
Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=54526&r1=54525&r2=54526&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Fri Aug 8 08:54:06 2008
@@ -823,6 +823,28 @@
const FieldDecl *getMember(unsigned i) const { return Members[i]; }
FieldDecl *getMember(unsigned i) { return Members[i]; }
+ // Iterator access to field members.
+ typedef FieldDecl **field_iterator;
+ typedef FieldDecl * const *field_const_iterator;
+
+ field_iterator field_begin() {
+ assert(isDefinition() && "Not a definition!");
+ return Members;
+ }
+ field_iterator field_end() {
+ assert(isDefinition() && "Not a definition!");
+ return Members + getNumMembers();
+ }
+
+ field_const_iterator field_begin() const {
+ assert(isDefinition() && "Not a definition!");
+ return Members;
+ }
+ field_const_iterator field_end() const {
+ assert(isDefinition() && "Not a definition!");
+ return Members + getNumMembers();
+ }
+
/// defineBody - When created, RecordDecl's correspond to a forward declared
/// record. This method is used to mark the decl as being defined, with the
/// specified contents.
More information about the cfe-commits
mailing list