diff options
author | Manuel Klimek <klimek@google.com> | 2013-06-10 08:52:15 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-06-10 08:52:15 +0000 |
commit | f30b17d8c319dfcccb9ff0fe07685a440622a1e8 (patch) | |
tree | d01739a2a4a44d7ee842d82902bc7e728911f366 /clang/docs/LibASTMatchersReference.html | |
parent | 67170bd71ace5f1097dbf788891bf56ec66d7699 (diff) | |
download | bcm5719-llvm-f30b17d8c319dfcccb9ff0fe07685a440622a1e8.tar.gz bcm5719-llvm-f30b17d8c319dfcccb9ff0fe07685a440622a1e8.zip |
Fixes the comment for hasDeclaration.
llvm-svn: 183640
Diffstat (limited to 'clang/docs/LibASTMatchersReference.html')
-rw-r--r-- | clang/docs/LibASTMatchersReference.html | 148 |
1 files changed, 117 insertions, 31 deletions
diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index 0ea55bfef54..c80a749df28 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -352,6 +352,16 @@ Example matches x.y() and y() </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('caseStmt0')"><a name="caseStmt0Anchor">caseStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CaseStmt.html">CaseStmt</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="caseStmt0"><pre>Matches case statements inside switch statements. + +Given + switch(a) { case 42: break; default: break; } +caseStmt() + matches 'case 42: break;'. +</pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('castExpr0')"><a name="castExpr0Anchor">castExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CastExpr.html">CastExpr</a>>...</td></tr> <tr><td colspan="4" class="doc" id="castExpr0"><pre>Matches any cast nodes of Clang's AST. @@ -471,6 +481,16 @@ Example matches the CXXDefaultArgExpr placeholder inserted for the </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('defaultStmt0')"><a name="defaultStmt0Anchor">defaultStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DefaultStmt.html">DefaultStmt</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="defaultStmt0"><pre>Matches default statements inside switch statements. + +Given + switch(a) { case 42: break; default: break; } +defaultStmt() + matches 'default: break;'. +</pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('deleteExpr0')"><a name="deleteExpr0Anchor">deleteExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDeleteExpr.html">CXXDeleteExpr</a>>...</td></tr> <tr><td colspan="4" class="doc" id="deleteExpr0"><pre>Matches delete expressions. @@ -2328,12 +2348,19 @@ Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockP <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('hasDeclaration3')"><a name="hasDeclaration3Anchor">hasDeclaration</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr> -<tr><td colspan="4" class="doc" id="hasDeclaration3"><pre>Matches a type if the declaration of the type matches the given -matcher. +<tr><td colspan="4" class="doc" id="hasDeclaration3"><pre>Matches a node if the declaration associated with that node +matches the given matcher. -In addition to being usable as Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, also usable as -Matcher<T> for any T supporting the getDecl() member function. e.g. various -subtypes of clang::Type. +The associated declaration is: +- for type nodes, the declaration of the underlying type +- for CallExpr, the declaration of the callee +- for MemberExpr, the declaration of the referenced member +- for CXXConstructExpr, the declaration of the constructor + +Also usable as Matcher<T> for any T supporting the getDecl() member +function. e.g. various subtypes of clang::Type and various expressions. +FIXME: Add all node types for which this is matcher is usable due to +getDecl(). Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, @@ -2496,12 +2523,19 @@ Example matches y in x(y) <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('hasDeclaration4')"><a name="hasDeclaration4Anchor">hasDeclaration</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr> -<tr><td colspan="4" class="doc" id="hasDeclaration4"><pre>Matches a type if the declaration of the type matches the given -matcher. +<tr><td colspan="4" class="doc" id="hasDeclaration4"><pre>Matches a node if the declaration associated with that node +matches the given matcher. -In addition to being usable as Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, also usable as -Matcher<T> for any T supporting the getDecl() member function. e.g. various -subtypes of clang::Type. +The associated declaration is: +- for type nodes, the declaration of the underlying type +- for CallExpr, the declaration of the callee +- for MemberExpr, the declaration of the referenced member +- for CXXConstructExpr, the declaration of the constructor + +Also usable as Matcher<T> for any T supporting the getDecl() member +function. e.g. various subtypes of clang::Type and various expressions. +FIXME: Add all node types for which this is matcher is usable due to +getDecl(). Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, @@ -2509,6 +2543,17 @@ Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualTy </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CaseStmt.html">CaseStmt</a>></td><td class="name" onclick="toggle('hasCaseConstant0')"><a name="hasCaseConstant0Anchor">hasCaseConstant</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr> +<tr><td colspan="4" class="doc" id="hasCaseConstant0"><pre>If the given case statement does not use the GNU case range +extension, matches the constant given in the statement. + +Given + switch (1) { case 1: case 1+1: case 3 ... 4: ; } +caseStmt(hasCaseConstant(integerLiteral())) + matches "case 1:" +</pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CastExpr.html">CastExpr</a>></td><td class="name" onclick="toggle('hasSourceExpression0')"><a name="hasSourceExpression0Anchor">hasSourceExpression</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr> <tr><td colspan="4" class="doc" id="hasSourceExpression0"><pre>Matches if the cast's source expression matches the given matcher. @@ -2944,12 +2989,19 @@ FIXME: Unit test this matcher <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>></td><td class="name" onclick="toggle('hasDeclaration2')"><a name="hasDeclaration2Anchor">hasDeclaration</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr> -<tr><td colspan="4" class="doc" id="hasDeclaration2"><pre>Matches a type if the declaration of the type matches the given -matcher. +<tr><td colspan="4" class="doc" id="hasDeclaration2"><pre>Matches a node if the declaration associated with that node +matches the given matcher. -In addition to being usable as Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, also usable as -Matcher<T> for any T supporting the getDecl() member function. e.g. various -subtypes of clang::Type. +The associated declaration is: +- for type nodes, the declaration of the underlying type +- for CallExpr, the declaration of the callee +- for MemberExpr, the declaration of the referenced member +- for CXXConstructExpr, the declaration of the constructor + +Also usable as Matcher<T> for any T supporting the getDecl() member +function. e.g. various subtypes of clang::Type and various expressions. +FIXME: Add all node types for which this is matcher is usable due to +getDecl(). Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, @@ -3142,12 +3194,19 @@ declaration of b but varDecl(hasType(qualType(hasCanonicalType(referenceType())) <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('hasDeclaration5')"><a name="hasDeclaration5Anchor">hasDeclaration</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr> -<tr><td colspan="4" class="doc" id="hasDeclaration5"><pre>Matches a type if the declaration of the type matches the given -matcher. +<tr><td colspan="4" class="doc" id="hasDeclaration5"><pre>Matches a node if the declaration associated with that node +matches the given matcher. -In addition to being usable as Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, also usable as -Matcher<T> for any T supporting the getDecl() member function. e.g. various -subtypes of clang::Type. +The associated declaration is: +- for type nodes, the declaration of the underlying type +- for CallExpr, the declaration of the callee +- for MemberExpr, the declaration of the referenced member +- for CXXConstructExpr, the declaration of the constructor + +Also usable as Matcher<T> for any T supporting the getDecl() member +function. e.g. various subtypes of clang::Type and various expressions. +FIXME: Add all node types for which this is matcher is usable due to +getDecl(). Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, @@ -3209,6 +3268,19 @@ sizeof. </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1SwitchStmt.html">SwitchStmt</a>></td><td class="name" onclick="toggle('forEachSwitchCase0')"><a name="forEachSwitchCase0Anchor">forEachSwitchCase</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1SwitchCase.html">SwitchCase</a>> InnerMatcher</td></tr> +<tr><td colspan="4" class="doc" id="forEachSwitchCase0"><pre>Matches each case or default statement belonging to the given switch +statement. This matcher may produce multiple matches. + +Given + switch (1) { case 1: case 2: default: switch (2) { case 3: case 4: ; } } +switchStmt(forEachSwitchCase(caseStmt().bind("c"))).bind("s") + matches four times, with "c" binding each of "case 1:", "case 2:", +"case 3:" and "case 4:", and "s" respectively binding "switch (1)", +"switch (1)", "switch (2)" and "switch (2)". +</pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>></td><td class="name" onclick="toggle('refersToDeclaration0')"><a name="refersToDeclaration0Anchor">refersToDeclaration</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr> <tr><td colspan="4" class="doc" id="refersToDeclaration0"><pre>Matches a TemplateArgument that refers to a certain declaration. @@ -3237,12 +3309,19 @@ classTemplateSpecializationDecl(hasAnyTemplateArgument( <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>></td><td class="name" onclick="toggle('hasDeclaration0')"><a name="hasDeclaration0Anchor">hasDeclaration</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr> -<tr><td colspan="4" class="doc" id="hasDeclaration0"><pre>Matches a type if the declaration of the type matches the given -matcher. +<tr><td colspan="4" class="doc" id="hasDeclaration0"><pre>Matches a node if the declaration associated with that node +matches the given matcher. + +The associated declaration is: +- for type nodes, the declaration of the underlying type +- for CallExpr, the declaration of the callee +- for MemberExpr, the declaration of the referenced member +- for CXXConstructExpr, the declaration of the constructor -In addition to being usable as Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, also usable as -Matcher<T> for any T supporting the getDecl() member function. e.g. various -subtypes of clang::Type. +Also usable as Matcher<T> for any T supporting the getDecl() member +function. e.g. various subtypes of clang::Type and various expressions. +FIXME: Add all node types for which this is matcher is usable due to +getDecl(). Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, @@ -3257,12 +3336,19 @@ QualType-matcher matches. <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>></td><td class="name" onclick="toggle('hasDeclaration1')"><a name="hasDeclaration1Anchor">hasDeclaration</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr> -<tr><td colspan="4" class="doc" id="hasDeclaration1"><pre>Matches a type if the declaration of the type matches the given -matcher. - -In addition to being usable as Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, also usable as -Matcher<T> for any T supporting the getDecl() member function. e.g. various -subtypes of clang::Type. +<tr><td colspan="4" class="doc" id="hasDeclaration1"><pre>Matches a node if the declaration associated with that node +matches the given matcher. + +The associated declaration is: +- for type nodes, the declaration of the underlying type +- for CallExpr, the declaration of the callee +- for MemberExpr, the declaration of the referenced member +- for CXXConstructExpr, the declaration of the constructor + +Also usable as Matcher<T> for any T supporting the getDecl() member +function. e.g. various subtypes of clang::Type and various expressions. +FIXME: Add all node types for which this is matcher is usable due to +getDecl(). Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>, |