typedef llvm::iterator_range<param_iterator> param_range;
typedef llvm::iterator_range<param_const_iterator> param_const_range;
- param_iterator param_begin() { return params().begin(); }
- param_iterator param_end() { return params().end(); }
+ param_iterator param_begin() { return param_iterator(ParamInfo); }
+ param_iterator param_end() {
+ return param_iterator(ParamInfo + param_size());
+ }
param_range params() {
return param_range(ParamInfo, ParamInfo + param_size());
}
- param_const_iterator param_begin() const { return params().begin(); }
- param_const_iterator param_end() const { return params().end(); }
+ param_const_iterator param_begin() const {
+ return param_const_iterator(ParamInfo);
+ }
+ param_const_iterator param_end() const {
+ return param_const_iterator(ParamInfo + param_size());
+ }
param_const_range params() const {
return param_const_range(ParamInfo, ParamInfo + param_size());
}
redecl_iterator());
}
- redecl_iterator redecls_begin() const { return redecls().begin(); }
- redecl_iterator redecls_end() const { return redecls().end(); }
+ redecl_iterator redecls_begin() const {
+ return redecl_iterator(const_cast<Decl *>(this));
+ }
+ redecl_iterator redecls_end() const { return redecl_iterator(); }
/// \brief Retrieve the previous declaration that declares the same entity
/// as this declaration, or NULL if there is no previous declaration.
/// decls_begin/decls_end - Iterate over the declarations stored in
/// this context.
decl_range decls() const;
- decl_iterator decls_begin() const { return decls().begin(); }
- decl_iterator decls_end() const { return decls().end(); }
+ decl_iterator decls_begin() const;
+ decl_iterator decls_end() const { return decl_iterator(); }
bool decls_empty() const;
/// noload_decls_begin/end - Iterate over the declarations stored in this
/// context that are currently loaded; don't attempt to retrieve anything
/// from an external source.
decl_range noload_decls() const;
- decl_iterator noload_decls_begin() const { return noload_decls().begin(); }
- decl_iterator noload_decls_end() const { return noload_decls().end(); }
+ decl_iterator noload_decls_begin() const;
+ decl_iterator noload_decls_end() const { return decl_iterator(); }
/// specific_decl_iterator - Iterates over a subrange of
/// declarations stored in a DeclContext, providing only those that
return param_const_range(getParams(), getParams() + NumParams);
}
- param_const_iterator param_begin() const { return params().begin(); }
- param_const_iterator param_end() const { return params().end(); }
- param_iterator param_begin() { return params().begin(); }
- param_iterator param_end() { return params().end(); }
+ param_const_iterator param_begin() const {
+ return param_const_iterator(getParams());
+ }
+ param_const_iterator param_end() const {
+ return param_const_iterator(getParams() + NumParams);
+ }
+ param_iterator param_begin() { return param_iterator(getParams()); }
+ param_iterator param_end() { return param_iterator(getParams() + NumParams); }
// This method returns and of the parameters which are part of the selector
// name mangling requirements.
redecl_iterator());
}
- redecl_iterator redecls_begin() const { return redecls().begin(); }
- redecl_iterator redecls_end() const { return redecls().end(); }
+ redecl_iterator redecls_begin() const {
+ return redecl_iterator(
+ const_cast<decl_type *>(static_cast<const decl_type *>(this)));
+ }
+ redecl_iterator redecls_end() const { return redecl_iterator(); }
friend class ASTDeclReader;
friend class ASTDeclWriter;
return decl_range(decl_iterator(FirstDecl), decl_iterator());
}
+DeclContext::decl_iterator DeclContext::noload_decls_begin() const {
+ return decl_iterator(FirstDecl);
+}
+
DeclContext::decl_range DeclContext::decls() const {
if (hasExternalLexicalStorage())
LoadLexicalDeclsFromExternalStorage();
return decl_range(decl_iterator(FirstDecl), decl_iterator());
}
+DeclContext::decl_iterator DeclContext::decls_begin() const {
+ if (hasExternalLexicalStorage())
+ LoadLexicalDeclsFromExternalStorage();
+ return decl_iterator(FirstDecl);
+}
+
bool DeclContext::decls_empty() const {
if (hasExternalLexicalStorage())
LoadLexicalDeclsFromExternalStorage();