This revision was automatically updated to reflect the committed changes. Closed by commit rL314022: [clang] Fix isExternC matcher docs (authored by alexshap).
Changed prior to commit: https://reviews.llvm.org/D38151?vs=116251&id=116386#toc Repository: rL LLVM https://reviews.llvm.org/D38151 Files: cfe/trunk/docs/LibASTMatchersReference.html cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h Index: cfe/trunk/docs/LibASTMatchersReference.html =================================================================== --- cfe/trunk/docs/LibASTMatchersReference.html +++ cfe/trunk/docs/LibASTMatchersReference.html @@ -2741,19 +2741,22 @@ 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>> </pre></td></tr> - <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isExternC0')"><a name="isExternC0Anchor">isExternC</a></td><td></td></tr> -<tr><td colspan="4" class="doc" id="isExternC0"><pre>Matches extern "C" function declarations. +<tr><td colspan="4" class="doc" id="isExternC0"><pre>Matches extern "C" function or variable declarations. Given: extern "C" void f() {} extern "C" { void g() {} } void h() {} + extern "C" int x = 1; + extern "C" int y = 2; + int z = 3; functionDecl(isExternC()) - matches the declaration of f and g, but not the declaration h + matches the declaration of f and g, but not the declaration of h. +varDecl(isExternC()) + matches the declaration of x and y, but not the declaration of z. </pre></td></tr> - <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isInline1')"><a name="isInline1Anchor">isInline</a></td><td></td></tr> <tr><td colspan="4" class="doc" id="isInline1"><pre>Matches function and namespace declarations that are marked with the inline keyword. @@ -3680,19 +3683,22 @@ 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>> </pre></td></tr> - <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isExternC1')"><a name="isExternC1Anchor">isExternC</a></td><td></td></tr> -<tr><td colspan="4" class="doc" id="isExternC1"><pre>Matches extern "C" function declarations. +<tr><td colspan="4" class="doc" id="isExternC1"><pre>Matches extern "C" function or variable declarations. Given: extern "C" void f() {} extern "C" { void g() {} } void h() {} + extern "C" int x = 1; + extern "C" int y = 2; + int z = 3; functionDecl(isExternC()) - matches the declaration of f and g, but not the declaration h + matches the declaration of f and g, but not the declaration of h. +varDecl(isExternC()) + matches the declaration of x and y, but not the declaration of z. </pre></td></tr> - <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isStaticStorageClass1')"><a name="isStaticStorageClass1Anchor">isStaticStorageClass</a></td><td></td></tr> <tr><td colspan="4" class="doc" id="isStaticStorageClass1"><pre>Matches variablefunction declarations that have "static" storage class specifier ("static" keyword) written in the source. Index: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h =================================================================== --- cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h +++ cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h @@ -3533,16 +3533,21 @@ return InnerMatcher.matches(Node.getReturnType(), Finder, Builder); } -/// \brief Matches extern "C" function declarations. +/// \brief Matches extern "C" function or variable declarations. /// /// Given: /// \code /// extern "C" void f() {} /// extern "C" { void g() {} } /// void h() {} +/// extern "C" int x = 1; +/// extern "C" int y = 2; +/// int z = 3; /// \endcode /// functionDecl(isExternC()) -/// matches the declaration of f and g, but not the declaration h +/// matches the declaration of f and g, but not the declaration of h. +/// varDecl(isExternC()) +/// matches the declaration of x and y, but not the declaration of z. AST_POLYMORPHIC_MATCHER(isExternC, AST_POLYMORPHIC_SUPPORTED_TYPES(FunctionDecl, VarDecl)) { return Node.isExternC();
Index: cfe/trunk/docs/LibASTMatchersReference.html =================================================================== --- cfe/trunk/docs/LibASTMatchersReference.html +++ cfe/trunk/docs/LibASTMatchersReference.html @@ -2741,19 +2741,22 @@ 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>> </pre></td></tr> - <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isExternC0')"><a name="isExternC0Anchor">isExternC</a></td><td></td></tr> -<tr><td colspan="4" class="doc" id="isExternC0"><pre>Matches extern "C" function declarations. +<tr><td colspan="4" class="doc" id="isExternC0"><pre>Matches extern "C" function or variable declarations. Given: extern "C" void f() {} extern "C" { void g() {} } void h() {} + extern "C" int x = 1; + extern "C" int y = 2; + int z = 3; functionDecl(isExternC()) - matches the declaration of f and g, but not the declaration h + matches the declaration of f and g, but not the declaration of h. +varDecl(isExternC()) + matches the declaration of x and y, but not the declaration of z. </pre></td></tr> - <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isInline1')"><a name="isInline1Anchor">isInline</a></td><td></td></tr> <tr><td colspan="4" class="doc" id="isInline1"><pre>Matches function and namespace declarations that are marked with the inline keyword. @@ -3680,19 +3683,22 @@ 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>> </pre></td></tr> - <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isExternC1')"><a name="isExternC1Anchor">isExternC</a></td><td></td></tr> -<tr><td colspan="4" class="doc" id="isExternC1"><pre>Matches extern "C" function declarations. +<tr><td colspan="4" class="doc" id="isExternC1"><pre>Matches extern "C" function or variable declarations. Given: extern "C" void f() {} extern "C" { void g() {} } void h() {} + extern "C" int x = 1; + extern "C" int y = 2; + int z = 3; functionDecl(isExternC()) - matches the declaration of f and g, but not the declaration h + matches the declaration of f and g, but not the declaration of h. +varDecl(isExternC()) + matches the declaration of x and y, but not the declaration of z. </pre></td></tr> - <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isStaticStorageClass1')"><a name="isStaticStorageClass1Anchor">isStaticStorageClass</a></td><td></td></tr> <tr><td colspan="4" class="doc" id="isStaticStorageClass1"><pre>Matches variablefunction declarations that have "static" storage class specifier ("static" keyword) written in the source. Index: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h =================================================================== --- cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h +++ cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h @@ -3533,16 +3533,21 @@ return InnerMatcher.matches(Node.getReturnType(), Finder, Builder); } -/// \brief Matches extern "C" function declarations. +/// \brief Matches extern "C" function or variable declarations. /// /// Given: /// \code /// extern "C" void f() {} /// extern "C" { void g() {} } /// void h() {} +/// extern "C" int x = 1; +/// extern "C" int y = 2; +/// int z = 3; /// \endcode /// functionDecl(isExternC()) -/// matches the declaration of f and g, but not the declaration h +/// matches the declaration of f and g, but not the declaration of h. +/// varDecl(isExternC()) +/// matches the declaration of x and y, but not the declaration of z. AST_POLYMORPHIC_MATCHER(isExternC, AST_POLYMORPHIC_SUPPORTED_TYPES(FunctionDecl, VarDecl)) { return Node.isExternC();
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits