[cfe-commits] r161035 - /cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h
Manuel Klimek
klimek at google.com
Mon Jul 30 23:28:58 PDT 2012
Author: klimek
Date: Tue Jul 31 01:28:58 2012
New Revision: 161035
URL: http://llvm.org/viewvc/llvm-project?rev=161035&view=rev
Log:
Document the result type of the matcher functions where
it's not obvious from the source code.
Modified:
cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h
Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h?rev=161035&r1=161034&r2=161035&view=diff
==============================================================================
--- cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h (original)
+++ cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h Tue Jul 31 01:28:58 2012
@@ -980,6 +980,8 @@
/// \brief Matches a type if the declaration of the type matches the given
/// matcher.
+///
+/// Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>
inline internal::PolymorphicMatcherWithParam1< internal::HasDeclarationMatcher,
internal::Matcher<Decl> >
hasDeclaration(const internal::Matcher<Decl> &InnerMatcher) {
@@ -1066,6 +1068,8 @@
/// and z (matcher = variable(hasType(record(hasName("X")))))
/// class X {};
/// void y(X &x) { x; X z; }
+///
+/// Usable as: Matcher<Expr>, Matcher<ValueDecl>
inline internal::PolymorphicMatcherWithParam1<
internal::matcher_hasTypeMatcher,
internal::Matcher<QualType> >
@@ -1499,6 +1503,9 @@
///
/// Example matches true (matcher = boolLiteral(equals(true)))
/// true
+///
+/// Usable as: Matcher<CharacterLiteral>, Matcher<CXXBoolLiteral>,
+/// Matcher<FloatingLiteral>, Matcher<IntegerLiteral>
template <typename ValueT>
internal::PolymorphicMatcherWithParam1<internal::ValueEqualsMatcher, ValueT>
equals(const ValueT &Value) {
@@ -1624,6 +1631,8 @@
/// 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<TagDecl>, Matcher<VarDecl>, Matcher<FunctionDecl>
inline internal::PolymorphicMatcherWithParam0<internal::IsDefinitionMatcher>
isDefinition() {
return internal::PolymorphicMatcherWithParam0<
@@ -1775,6 +1784,8 @@
/// template <> class X<A> {}; X<A> x;
/// record(hasName("::X"), isTemplateInstantiation())
/// does not match, as X<A> is an explicit template specialization.
+///
+/// Usable as: Matcher<FunctionDecl>, Matcher<VarDecl>, Matcher<CXXRecordDecl>
inline internal::PolymorphicMatcherWithParam0<
internal::IsTemplateInstantiationMatcher>
isTemplateInstantiation() {
More information about the cfe-commits
mailing list