r278213 - [ASTMatchers] Extend documentation for match()
Martin Bohme via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 10 04:22:58 PDT 2016
Date: Wed Aug 10 06:22:57 2016
New Revision: 278213
[ASTMatchers] Extend documentation for match()
Adds an explanation of how to use findAll() to find all matches in a subtree.
--- cfe/trunk/include/clang/ASTMatchers/ASTMatchFinder.h (original)
+++ cfe/trunk/include/clang/ASTMatchers/ASTMatchFinder.h Wed Aug 10 06:22:57 2016
@@ -229,6 +229,10 @@ private:
/// Multiple results occur when using matchers like \c forEachDescendant,
/// which generate a result for each sub-match.
+/// If you want to find all matches on the sub-tree rooted at \c Node (rather
+/// than only the matches on \c Node itself), surround the \c Matcher with a
+/// \c findAll().
/// \see selectFirst
template <typename MatcherT, typename NodeT>
More information about the cfe-commits