[PATCH] D19324: [ASTMatchers] new forEachOverriden matcher

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue May 3 09:10:00 PDT 2016


aaron.ballman added inline comments.

================
Comment at: include/clang/AST/ASTContext.h:824
@@ -823,1 +823,3 @@
   unsigned overridden_methods_size(const CXXMethodDecl *Method) const;
+  const ArrayRef<const CXXMethodDecl *> overridden_methods(
+      const CXXMethodDecl *Method) const;
----------------
courbet wrote:
> aaron.ballman wrote:
> > This is too tight of a coupling to the underlying datatype. It should return `iterator_range<overridden_cxx_method_iterator>`
> This is the exact opposite of the change that Samuel just requested (implementing the iterators in term of the ArrayRef getter). I don't have a strong opinion on this, but could you two agree on the desired API ?
I hadn't noticed that we disagreed, sorry for the conflicting advice. However, I strongly think that we should use an abstraction, and that ArrayRef is too concrete. FWIW, we use iterator_range in almost every other case in the code base when we refactored to rangify code.


http://reviews.llvm.org/D19324





More information about the cfe-commits mailing list