diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -554,6 +554,21 @@ bool hasDefinition() const { return DefinitionData || dataPtr(); } + RecordDecl::field_iterator field_begin() const { + assert(hasDefinition() && "Definition not available to get fields."); + return static_cast(getDefinition())->field_begin(); + } + + RecordDecl::field_iterator field_end() const { + return field_iterator(decl_iterator()); + } + + RecordDecl::field_range fields() const { + return field_range(field_begin(), field_end()); + } + + bool field_empty() const { return field_begin() == field_end(); } + static CXXRecordDecl *Create(const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id,