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
Author: mboehme
Date: Wed Aug 10 06:22:57 2016
New Revision: 278213
URL: http://llvm.org/viewvc/llvm-project?rev=278213&view=rev
Log:
[ASTMatchers] Extend documentation for match()
Summary:
Adds an explanation of how to use findAll() to find all matches in a subtree.
Modified:
cfe/trunk/include/clang/ASTMatchers/ASTMatchFinder.h
Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchFinder.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchFinder.h?rev=278213&r1=278212&r2=278213&view=diff
==============================================================================
--- 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
mailing list