10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_MATCHERS_H 11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_MATCHERS_H 14 #include "clang/ASTMatchers/ASTMatchers.h" 21 return Node.isAssignmentOp();
25 return Node.isRelationalOp();
28 AST_MATCHER(BinaryOperator, isEqualityOperator) {
return Node.isEqualityOp(); }
31 return Node.isComparisonOp();
35 llvm::Optional<bool> IsExpensive =
37 return IsExpensive && *IsExpensive;
42 Node, Finder->getASTContext());
47 using namespace ast_matchers;
48 return referenceType(pointee(qualType(isConstQualified())));
51 AST_MATCHER_P(NamedDecl, matchesAnyListedName, std::vector<std::string>,
53 return llvm::any_of(NameList, [&Node](
const std::string &
Name) {
54 return llvm::Regex(Name).match(Node.getName());
62 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_MATCHERS_H AST_MATCHER(BinaryOperator, isAssignmentOperator)
AST_MATCHER_FUNCTION(ast_matchers::TypeMatcher, isReferenceToConst)
bool recordIsTriviallyDefaultConstructible(const RecordDecl &RecordDecl, const ASTContext &Context)
Returns true if RecordDecl is trivially default constructible.
llvm::Optional< bool > isExpensiveToCopy(QualType Type, const ASTContext &Context)
Returns true if Type is expensive to copy.
bool isTriviallyDefaultConstructible(QualType Type, const ASTContext &Context)
Returns true if Type is trivially default constructible.
static constexpr llvm::StringLiteral Name
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
AST_MATCHER_P(NamedDecl, matchesAnyListedName, std::vector< std::string >, NameList)