diff options
author | Manuel Klimek <klimek@google.com> | 2012-08-26 23:55:24 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2012-08-26 23:55:24 +0000 |
commit | e44a006c4916483da109c9786b02c6c8d16618db (patch) | |
tree | 2a46c01a870179a04fbaefddef0911a6489218df /docs/LibASTMatchersReference.html | |
parent | b41ba1aa47a66979df578074de3c218d820c152d (diff) |
Update reference docs to latest changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162650 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/LibASTMatchersReference.html')
-rw-r--r-- | docs/LibASTMatchersReference.html | 340 |
1 files changed, 177 insertions, 163 deletions
diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html index a371b3bfcf..55ac8ca4b3 100644 --- a/docs/LibASTMatchersReference.html +++ b/docs/LibASTMatchersReference.html @@ -76,28 +76,28 @@ match callback.</p> <tr style="text-align:left"><th>Return type</th><th>Name</th><th>Parameters</th></tr> <!-- START_DECL_MATCHERS --> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('classTemplate0')">classTemplate</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateDecl.html">ClassTemplateDecl</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="classTemplate0"><pre>Matches C++ class template declarations. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('classTemplateDecl0')">classTemplateDecl</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateDecl.html">ClassTemplateDecl</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="classTemplateDecl0"><pre>Matches C++ class template declarations. Example matches Z template<class T> class Z {}; </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('classTemplateSpecialization0')">classTemplateSpecialization</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateSpecializationDecl.html">ClassTemplateSpecializationDecl</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="classTemplateSpecialization0"><pre>Matches C++ class template specializations. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('classTemplateSpecializationDecl0')">classTemplateSpecializationDecl</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateSpecializationDecl.html">ClassTemplateSpecializationDecl</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="classTemplateSpecializationDecl0"><pre>Matches C++ class template specializations. Given template<typename T> class A {}; template<> class A<double> {}; A<int> a; -classTemplateSpecialization() +classTemplateSpecializationDecl() matches the specializations A<int> and A<double> </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('constructor0')">constructor</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="constructor0"><pre>Matches C++ constructor declarations. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('constructorDecl0')">constructorDecl</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="constructorDecl0"><pre>Matches C++ constructor declarations. Example matches Foo::Foo() and Foo::Foo(int) class Foo { @@ -120,8 +120,8 @@ Examples matches X, C, and the friend declaration inside C; </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('destructor0')">destructor</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDestructorDecl.html">CXXDestructorDecl</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="destructor0"><pre>Matches explicit C++ destructor declarations. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('destructorDecl0')">destructorDecl</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDestructorDecl.html">CXXDestructorDecl</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="destructorDecl0"><pre>Matches explicit C++ destructor declarations. Example matches Foo::~Foo() class Foo { @@ -131,8 +131,8 @@ Example matches Foo::~Foo() </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('enumConstant0')">enumConstant</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumConstantDecl.html">EnumConstantDecl</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="enumConstant0"><pre>Matches enum constants. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('enumConstantDecl0')">enumConstantDecl</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumConstantDecl.html">EnumConstantDecl</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="enumConstantDecl0"><pre>Matches enum constants. Example matches A, B, C enum X { @@ -151,42 +151,42 @@ Example matches X </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('field0')">field</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FieldDecl.html">FieldDecl</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="field0"><pre>Matches field declarations. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('fieldDecl0')">fieldDecl</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FieldDecl.html">FieldDecl</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="fieldDecl0"><pre>Matches field declarations. Given class X { int m; }; -field() +fieldDecl() matches 'm'. </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('function0')">function</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="function0"><pre>Matches function declarations. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('functionDecl0')">functionDecl</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="functionDecl0"><pre>Matches function declarations. Example matches f void f(); </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('functionTemplate0')">functionTemplate</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionTemplateDecl.html">FunctionTemplateDecl</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="functionTemplate0"><pre>Matches C++ function template declarations. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('functionTemplateDecl0')">functionTemplateDecl</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionTemplateDecl.html">FunctionTemplateDecl</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="functionTemplateDecl0"><pre>Matches C++ function template declarations. Example matches f template<class T> void f(T t) {} </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('method0')">method</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="method0"><pre>Matches method declarations. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('methodDecl0')">methodDecl</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="methodDecl0"><pre>Matches method declarations. Example matches y class X { void y() }; </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('nameableDeclaration0')">nameableDeclaration</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="nameableDeclaration0"><pre>Matches a declaration of anything that could have a name. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('namedDecl0')">namedDecl</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="namedDecl0"><pre>Matches a declaration of anything that could have a name. Example matches X, S, the anonymous union type, i, and U; typedef int X; @@ -198,8 +198,8 @@ Example matches X, S, the anonymous union type, i, and U; </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('record0')">record</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="record0"><pre>Matches C++ class declarations. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('recordDecl0')">recordDecl</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="recordDecl0"><pre>Matches C++ class declarations. Example matches X, Z class X; @@ -217,8 +217,8 @@ usingDecl() matches using X::x </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('variable0')">variable</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="variable0"><pre>Matches variable declarations. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('varDecl0')">varDecl</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="varDecl0"><pre>Matches variable declarations. Note: this does not match declarations of member variables, which are "field" declarations in Clang parlance. @@ -260,8 +260,8 @@ Example matches 'a', L'a' </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('constCast0')">constCast</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstCastExpr.html">CXXConstCastExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="constCast0"><pre>Matches a const_cast expression. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('constCastExpr0')">constCastExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstCastExpr.html">CXXConstCastExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="constCastExpr0"><pre>Matches a const_cast expression. Example: Matches const_cast<int*>(&r) in int n = 42; @@ -270,11 +270,11 @@ Example: Matches const_cast<int*>(&r) in </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('dynamicCast0')">dynamicCast</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDynamicCastExpr.html">CXXDynamicCastExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="dynamicCast0"><pre>Matches a dynamic_cast expression. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('dynamicCastExpr0')">dynamicCastExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDynamicCastExpr.html">CXXDynamicCastExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="dynamicCastExpr0"><pre>Matches a dynamic_cast expression. Example: - dynamicCast() + dynamicCastExpr() matches dynamic_cast<D*>(&b); in @@ -284,8 +284,8 @@ in </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('explicitCast0')">explicitCast</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ExplicitCastExpr.html">ExplicitCastExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="explicitCast0"><pre>Matches explicit cast expressions. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('explicitCastExpr0')">explicitCastExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ExplicitCastExpr.html">ExplicitCastExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="explicitCastExpr0"><pre>Matches explicit cast expressions. Matches any cast expression written in user code, whether it be a C-style cast, a functional-style cast, or a keyword cast. @@ -305,8 +305,8 @@ but does not match the implicit conversion in </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('functionalCast0')">functionalCast</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXFunctionalCastExpr.html">CXXFunctionalCastExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="functionalCast0"><pre>Matches functional cast expressions +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('functionalCastExpr0')">functionalCastExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXFunctionalCastExpr.html">CXXFunctionalCastExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="functionalCastExpr0"><pre>Matches functional cast expressions Example: Matches Foo(bar); Foo f = bar; @@ -315,8 +315,8 @@ Example: Matches Foo(bar); </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('implicitCast0')">implicitCast</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ImplicitCastExpr.html">ImplicitCastExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="implicitCast0"><pre>Matches the implicit cast nodes of Clang's AST. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('implicitCastExpr0')">implicitCastExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ImplicitCastExpr.html">ImplicitCastExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="implicitCastExpr0"><pre>Matches the implicit cast nodes of Clang's AST. This matches many different places, including function call return value eliding, as well as any type conversions. @@ -332,8 +332,8 @@ Example matches 1, 1L, 0x1, 1U </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('reinterpretCast0')">reinterpretCast</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXReinterpretCastExpr.html">CXXReinterpretCastExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="reinterpretCast0"><pre>Matches a reinterpret_cast expression. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('reinterpretCastExpr0')">reinterpretCastExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXReinterpretCastExpr.html">CXXReinterpretCastExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="reinterpretCastExpr0"><pre>Matches a reinterpret_cast expression. Either the source expression or the destination type can be matched using has(), but hasDestinationType() is more specific and can be @@ -344,14 +344,14 @@ Example matches reinterpret_cast<char*>(&p) in </pre></td></tr> -<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('staticCast0')">staticCast</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXStaticCastExpr.html">CXXStaticCastExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="staticCast0"><pre>Matches a C++ static_cast expression. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('staticCastExpr0')">staticCastExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXStaticCastExpr.html">CXXStaticCastExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="staticCastExpr0"><pre>Matches a C++ static_cast expression. hasDestinationType reinterpretCast Example: - staticCast() + staticCastExpr() matches static_cast<long>(8) in @@ -385,18 +385,18 @@ Example matches a || b </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('bindTemporaryExpression0')">bindTemporaryExpression</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBindTemporaryExpr.html">CXXBindTemporaryExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="bindTemporaryExpression0"><pre>Matches nodes where temporaries are created. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('bindTemporaryExpr0')">bindTemporaryExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBindTemporaryExpr.html">CXXBindTemporaryExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="bindTemporaryExpr0"><pre>Matches nodes where temporaries are created. Example matches FunctionTakesString(GetStringByValue()) - (matcher = bindTemporaryExpression()) + (matcher = bindTemporaryExpr()) FunctionTakesString(GetStringByValue()); FunctionTakesStringByPointer(GetStringPointer()); </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('call0')">call</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="call0"><pre>Matches call expressions. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('callExpr0')">callExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="callExpr0"><pre>Matches call expressions. Example matches x.y() and y() X x; @@ -405,8 +405,8 @@ 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('compoundStatement0')">compoundStatement</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CompoundStmt.html">CompoundStmt</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="compoundStatement0"><pre>Matches compound statements. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('compoundStmt0')">compoundStmt</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CompoundStmt.html">CompoundStmt</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="compoundStmt0"><pre>Matches compound statements. Example matches '{}' and '{{}}'in 'for (;;) {{}}' for (;;) {{}} @@ -421,11 +421,11 @@ Example matches a ? b : c </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('constructorCall0')">constructorCall</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="constructorCall0"><pre>Matches constructor call expressions (including implicit ones). +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('constructExpr0')">constructExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="constructExpr0"><pre>Matches constructor call expressions (including implicit ones). Example matches string(ptr, n) and ptr within arguments of f - (matcher = constructorCall()) + (matcher = constructExpr()) void f(const string &a, const string &b); char *ptr; int n; @@ -433,8 +433,8 @@ Example matches string(ptr, n) and ptr within arguments of f </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('declarationReference0')">declarationReference</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="declarationReference0"><pre>Matches expressions that refer to declarations. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('declRefExpr0')">declRefExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="declRefExpr0"><pre>Matches expressions that refer to declarations. Example matches x in if (x) bool x; @@ -442,33 +442,33 @@ Example matches x in if (x) </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('declarationStatement0')">declarationStatement</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html">DeclStmt</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="declarationStatement0"><pre>Matches declaration statements. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('declStmt0')">declStmt</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html">DeclStmt</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="declStmt0"><pre>Matches declaration statements. Given int a; -declarationStatement() +declStmt() matches 'int a'. </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('defaultArgument0')">defaultArgument</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDefaultArgExpr.html">CXXDefaultArgExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="defaultArgument0"><pre>Matches the value of a default argument at the call site. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('defaultArgExpr0')">defaultArgExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDefaultArgExpr.html">CXXDefaultArgExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="defaultArgExpr0"><pre>Matches the value of a default argument at the call site. Example matches the CXXDefaultArgExpr placeholder inserted for the default value of the second parameter in the call expression f(42) - (matcher = defaultArgument()) + (matcher = defaultArgExpr()) void f(int x, int y = 0); f(42); </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('deleteExpression0')">deleteExpression</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="deleteExpression0"><pre>Matches delete expressions. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('deleteExpr0')">deleteExpr</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. Given delete X; -deleteExpression() +deleteExpr() matches 'delete X'. </pre></td></tr> @@ -483,8 +483,8 @@ doStmt() </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('expression0')">expression</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="expression0"><pre>Matches expressions. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('expr0')">expr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="expr0"><pre>Matches expressions. Example matches x() void f() { x(); } @@ -519,8 +519,24 @@ initList() </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('memberCall0')">memberCall</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="memberCall0"><pre>Matches member call expressions. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('materializeTemporaryExpr0')">materializeTemporaryExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MaterializeTemporaryExpr.html">MaterializeTemporaryExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="materializeTemporaryExpr0"><pre>Matches nodes where temporaries are materialized. + +Example: Given + struct T {void func()}; + T f(); + void g(T); +materializeTemporaryExpr() matches 'f()' in these statements + T u(f()); + g(f()); +but does not match + f(); + f().func(); +</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('memberCallExpr0')">memberCallExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="memberCallExpr0"><pre>Matches member call expressions. Example matches x.y() X x; @@ -528,31 +544,31 @@ Example matches x.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('memberExpression0')">memberExpression</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="memberExpression0"><pre>Matches member expressions. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('memberExpr0')">memberExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="memberExpr0"><pre>Matches member expressions. Given class Y { void x() { this->x(); x(); Y y; y.x(); a; this->b; Y::b; } int a; static int b; }; -memberExpression() +memberExpr() matches this->x, x, y.x, a, this->b </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('newExpression0')">newExpression</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNewExpr.html">CXXNewExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="newExpression0"><pre>Matches new expressions. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('newExpr0')">newExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNewExpr.html">CXXNewExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="newExpr0"><pre>Matches new expressions. Given new X; -newExpression() +newExpr() matches 'new X'. </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('overloadedOperatorCall0')">overloadedOperatorCall</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="overloadedOperatorCall0"><pre>Matches overloaded operator calls. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('operatorCallExpr0')">operatorCallExpr</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="operatorCallExpr0"><pre>Matches overloaded operator calls. Note that if an operator isn't overloaded, it won't match. Instead, use binaryOperator matcher. @@ -560,19 +576,19 @@ Currently it does not match operators such as new delete. FIXME: figure out why these do not match? Example matches both operator<<((o << b), c) and operator<<(o, b) - (matcher = overloadedOperatorCall()) + (matcher = operatorCallExpr()) ostream &operator<< (ostream &out, int i) { }; ostream &o; int b = 1, c = 1; o << b << c; </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('statement0')">statement</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>...</td></tr> -<tr><td colspan="4" class="doc" id="statement0"><pre>Matches statements. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('stmt0')">stmt</td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>...</td></tr> +<tr><td colspan="4" class="doc" id="stmt0"><pre>Matches statements. Given { ++a; } -statement() +stmt() matches both the compound statement '{ ++a; }' and '++a'. </pre></td></tr> @@ -665,7 +681,7 @@ Usable as: Any Matcher <tr><td>Matcher<*></td><td class="name" onclick="toggle('unless0')">unless</td><td>Matcher<*> InnerMatcher</td></tr> <tr><td colspan="4" class="doc" id="unless0"><pre>Matches if the provided matcher does not match. -Example matches Y (matcher = record(unless(hasName("X")))) +Example matches Y (matcher = recordDecl(unless(hasName("X")))) class X {}; class Y {}; @@ -709,7 +725,7 @@ Given Foo(int) : foo_("A") { } string foo_; }; -constructor(hasAnyConstructorInitializer(isWritten())) +constructorDecl(hasAnyConstructorInitializer(isWritten())) will match Foo(int), but not Foo() </pre></td></tr> @@ -721,7 +737,7 @@ Matches overloaded operator names specified in strings without the "operator" prefix, such as "<<", for OverloadedOperatorCall's. Example matches a << b - (matcher == overloadedOperatorCall(hasOverloadedOperatorName("<<"))) + (matcher == operatorCallExpr(hasOverloadedOperatorName("<<"))) a << b; c && d; assuming both operator<< and operator&& are overloaded somewhere. @@ -740,7 +756,7 @@ static member variable template instantiations. Given template<typename T> void A(T t) { } template<> void A(int N) { } -function(isExplicitSpecialization()) +functionDecl(isExplicitTemplateSpecialization()) matches the specialization A<int>(). Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>> @@ -755,13 +771,13 @@ Given template <typename T> class X {}; class A {}; X<A> x; or template <typename T> class X {}; class A {}; template class X<A>; -record(hasName("::X"), isTemplateInstantiation()) +recordDecl(hasName("::X"), isTemplateInstantiation()) matches the template instantiation of X<A>. But given template <typename T> class X {}; class A {}; template <> class X<A> {}; X<A> x; -record(hasName("::X"), isTemplateInstantiation()) +recordDecl(hasName("::X"), isTemplateInstantiation()) does not match, as X<A> is an explicit template specialization. Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>> @@ -772,7 +788,7 @@ Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Functi <tr><td colspan="4" class="doc" id="argumentCountIs0"><pre>Checks that a call expression or a constructor call expression has a specific number of arguments (including absent default arguments). -Example matches f(0, 0) (matcher = call(argumentCountIs(2))) +Example matches f(0, 0) (matcher = callExpr(argumentCountIs(2))) void f(int x, int y); f(0, 0); </pre></td></tr> @@ -795,7 +811,7 @@ child statements. Example: Given { for (;;) {} } -compoundStatement(statementCountIs(0))) +compoundStmt(statementCountIs(0))) matches '{}' but does not match the outer compound statement. </pre></td></tr> @@ -847,7 +863,7 @@ static member variable template instantiations. Given template<typename T> void A(T t) { } template<> void A(int N) { } -function(isExplicitSpecialization()) +functionDecl(isExplicitTemplateSpecialization()) matches the specialization A<int>(). Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>> @@ -861,7 +877,7 @@ Given: extern "C" void f() {} extern "C" { void g() {} } void h() {} -function(isExternC()) +functionDecl(isExternC()) matches the declaration of f and g, but not the declaration h </pre></td></tr> @@ -874,13 +890,13 @@ Given template <typename T> class X {}; class A {}; X<A> x; or template <typename T> class X {}; class A {}; template class X<A>; -record(hasName("::X"), isTemplateInstantiation()) +recordDecl(hasName("::X"), isTemplateInstantiation()) matches the template instantiation of X<A>. But given template <typename T> class X {}; class A {}; template <> class X<A> {}; X<A> x; -record(hasName("::X"), isTemplateInstantiation()) +recordDecl(hasName("::X"), isTemplateInstantiation()) does not match, as X<A> is an explicit template specialization. Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>> @@ -910,7 +926,7 @@ Given int a; static int b; }; -memberExpression(isArrow()) +memberExpr(isArrow()) matches this->x, x, y.x, a, this->b </pre></td></tr> @@ -952,7 +968,7 @@ Example matches X (regexp is one of "::X", "^foo::.*X", among others) Given class Y { public: void x(); }; |