Matches methods overridden by the given method.
Details
Diff Detail
Event Timeline
include/clang/ASTMatchers/ASTMatchers.h | ||
---|---|---|
3775 | Extraneous ", and" at the end of comment. |
unittests/ASTMatchers/ASTMatchersTest.cpp | ||
---|---|---|
2084 ↗ | (On Diff #54462) | matchAndVerifyResultConditionally deletes them: template <typename T> testing::AssertionResult matchAndVerifyResultConditionally(const std::string &Code, const T &AMatcher, BoundNodesCallback *FindResultVerifier, bool ExpectResult) { std::unique_ptr<BoundNodesCallback> ScopedVerifier(FindResultVerifier); I'll send you a (separate) patch for taking a unique_ptr in. |
include/clang/ASTMatchers/ASTMatchers.h | ||
---|---|---|
3780 | I could do that , but it would require adding: const CXXMethodVector* ASTContext::overridden_methods() const; And plumbing it through. (or did I miss something ?) Let me know what you think. |
include/clang/ASTMatchers/ASTMatchers.h | ||
---|---|---|
3780 | I think it's an oversight that we don't have the range form of that function, and this seems like a reasonable use case to add it. |
- add overridden_methods() to CXXMethodDecl and plumbing.
- Use range-based for loop for iterating over overridden methods.
lib/AST/ASTContext.cpp | ||
---|---|---|
1280 | It would be simpler to return ArrayRef<const CXXMethodDecl*>. |
include/clang/AST/DeclCXX.h | ||
---|---|---|
1832 | Return type should have have toplevel const. | |
lib/AST/ASTContext.cpp | ||
1256–1257 | I would invert the calls here. |
include/clang/AST/ASTContext.h | ||
---|---|---|
824 | 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 ? |
include/clang/AST/ASTContext.h | ||
---|---|---|
824 | 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. |
include/clang/AST/ASTContext.h | ||
---|---|---|
824 | Samuel, are you OK with this (reverting the last change and using iterator_range instead of ArrayRef) ? |
LGTM, with one minor nit. Thank you for working on this!
include/clang/ASTMatchers/ASTMatchers.h | ||
---|---|---|
3780 | Nit: the * should bind to Overridden instead of auto. (May just want to clang-format the patch.) |
Thanks. Could please you submit this for me ?
include/clang/ASTMatchers/ASTMatchers.h | ||
---|---|---|
3780 | Thanks for the catch. Unfortunately there are a lot of errors in the file that prevent me to run clang-format. Any hint to handle that efficiently ? |
include/clang/ASTMatchers/ASTMatchers.h | ||
---|---|---|
3780 | There's a script that you can use to reformat just the contents of a diff: http://clang.llvm.org/docs/ClangFormat.html#script-for-patch-reformatting |
clang-format diff
include/clang/ASTMatchers/ASTMatchers.h | ||
---|---|---|
3780 | Thanks for the pointer ! |
include/clang/AST/ASTContext.h | ||
---|---|---|
824 | Sure. Sorry about that. |
@sbenza @aaron.ballman I don't have write access. Can one of you submit this on my behalf ? Thanks !
This is too tight of a coupling to the underlying datatype. It should return iterator_range<overridden_cxx_method_iterator>