[PATCH] D42213: [ASTMatchers] [NFC] Fix code examples
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 19 12:00:07 PST 2018
MaskRay added a comment.
I am also not sure about this function: line 3548
/// \brief Matches \c FunctionDecls and \c FunctionProtoTypes that have a
/// specific parameter count.
///
/// Given
/// \code
/// void f(int i) {}
/// void g(int i, int j) {}
/// void h(int i, int j);
/// void j(int i);
/// void k(int x, int y, int z, ...);
/// \endcode
/// functionDecl(parameterCountIs(2))
/// matches void g(int i, int j) {}
/// functionProtoType(parameterCountIs(2))
/// matches void h(int i, int j)
/// functionProtoType(parameterCountIs(3))
/// matches void k(int x, int y, int z, ...);
AST_POLYMORPHIC_MATCHER_P(parameterCountIs,
AST_POLYMORPHIC_SUPPORTED_TYPES(FunctionDecl,
FunctionProtoType),
}
Both `functionDecl` and `functionProtoType` match these functions as long as the parameter count is matched.
% echo 'match functionDecl()'|clang-query =(printf 'void f(){}') -- -xc++
% echo 'match functionProtoType()'|clang-query =(printf 'void f(){}') -- -xc++
Repository:
rC Clang
https://reviews.llvm.org/D42213
More information about the cfe-commits
mailing list