From 297f71daa4eec8beb2eb29573e0892539f8e7172 Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Tue, 31 Jul 2012 06:28:58 +0000 Subject: [PATCH] Document the result type of the matcher functions where it's not obvious from the source code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161035 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/ASTMatchers/ASTMatchers.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/clang/ASTMatchers/ASTMatchers.h b/include/clang/ASTMatchers/ASTMatchers.h index a5348d0baa..37e82e8318 100644 --- a/include/clang/ASTMatchers/ASTMatchers.h +++ b/include/clang/ASTMatchers/ASTMatchers.h @@ -980,6 +980,8 @@ internal::PolymorphicMatcherWithParam1 unless(const M & /// \brief Matches a type if the declaration of the type matches the given /// matcher. +/// +/// Usable as: Matcher, Matcher, Matcher inline internal::PolymorphicMatcherWithParam1< internal::HasDeclarationMatcher, internal::Matcher > hasDeclaration(const internal::Matcher &InnerMatcher) { @@ -1066,6 +1068,8 @@ AST_POLYMORPHIC_MATCHER_P(hasType, internal::Matcher, /// and z (matcher = variable(hasType(record(hasName("X"))))) /// class X {}; /// void y(X &x) { x; X z; } +/// +/// Usable as: Matcher, Matcher inline internal::PolymorphicMatcherWithParam1< internal::matcher_hasTypeMatcher, internal::Matcher > @@ -1499,6 +1503,9 @@ AST_MATCHER_P(CompoundStmt, statementCountIs, unsigned, N) { /// /// Example matches true (matcher = boolLiteral(equals(true))) /// true +/// +/// Usable as: Matcher, Matcher, +/// Matcher, Matcher template internal::PolymorphicMatcherWithParam1 equals(const ValueT &Value) { @@ -1624,6 +1631,8 @@ AST_MATCHER_P(ConditionalOperator, hasFalseExpression, /// extern int vb; // Doesn't match, as it doesn't define the variable. /// void fa() {} /// void fb(); // Doesn't match, as it has no body. +/// +/// Usable as: Matcher, Matcher, Matcher inline internal::PolymorphicMatcherWithParam0 isDefinition() { return internal::PolymorphicMatcherWithParam0< @@ -1775,6 +1784,8 @@ AST_MATCHER_P(UsingShadowDecl, hasTargetDecl, /// template <> class X {}; X x; /// record(hasName("::X"), isTemplateInstantiation()) /// does not match, as X is an explicit template specialization. +/// +/// Usable as: Matcher, Matcher, Matcher inline internal::PolymorphicMatcherWithParam0< internal::IsTemplateInstantiationMatcher> isTemplateInstantiation() {