diff options
| author | Clement Courbet <courbet@google.com> | 2016-06-10 11:54:43 +0000 |
|---|---|---|
| committer | Clement Courbet <courbet@google.com> | 2016-06-10 11:54:43 +0000 |
| commit | 8251ebfac6559739a9238053a74a816dbdc54b21 (patch) | |
| tree | 5226b4480583f132c446ddaf419195a6211f77ed /clang/docs | |
| parent | b16907f17abaa49469a5a6538a938127f247d31f (diff) | |
| download | bcm5719-llvm-8251ebfac6559739a9238053a74a816dbdc54b21.tar.gz bcm5719-llvm-8251ebfac6559739a9238053a74a816dbdc54b21.zip | |
[ASTMatchers] New forEachOverriden matcher.
Matches methods overridden by the given method.
llvm-svn: 272386
Diffstat (limited to 'clang/docs')
| -rw-r--r-- | clang/docs/LibASTMatchersReference.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index 3606367d2fd..5ab35568907 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -3968,6 +3968,30 @@ matcher, or is a pointer to a type that matches the InnerMatcher. </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('forEachOverridden0')"><a name="forEachOverridden0Anchor">forEachOverridden</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>> InnerMatcher</td></tr> +<tr><td colspan="4" class="doc" id="forEachOverridden0"><pre>Matches each method overriden by the given method. This matcher may +produce multiple matches. + +Given + class A { virtual void f(); }; + class B : public A { void f(); }; + class C : public B { void f(); }; +cxxMethodDecl(ofClass(hasName("C")), + forEachOverridden(cxxMethodDecl().bind("b"))).bind("d") + matches once, with "b" binding "A::f" and "d" binding "C::f" (Note + that B::f is not overridden by C::f). + +The check can produce multiple matches in case of multiple inheritance, e.g. + class A1 { virtual void f(); }; + class A2 { virtual void f(); }; + class C : public A1, public A2 { void f(); }; +cxxMethodDecl(ofClass(hasName("C")), + forEachOverridden(cxxMethodDecl().bind("b"))).bind("d") + matches twice, once with "b" binding "A1::f" and "d" binding "C::f", and + once with "b" binding "A2::f" and "d" binding "C::f". +</pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('ofClass0')"><a name="ofClass0Anchor">ofClass</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>> InnerMatcher</td></tr> <tr><td colspan="4" class="doc" id="ofClass0"><pre>Matches the class declaration that the given method declaration belongs to. |

