9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_MATCHERS_H 10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_MATCHERS_H 13 #include "clang/ASTMatchers/ASTMatchers.h" 20 return Node.isAssignmentOp();
24 return Node.isRelationalOp();
27 AST_MATCHER(BinaryOperator, isEqualityOperator) {
return Node.isEqualityOp(); }
30 return Node.isComparisonOp();
34 llvm::Optional<bool> IsExpensive =
36 return IsExpensive && *IsExpensive;
41 Node, Finder->getASTContext());
50 using namespace ast_matchers;
51 return referenceType(pointee(qualType(isConstQualified())));
54 AST_MATCHER_P(NamedDecl, matchesAnyListedName, std::vector<std::string>,
56 return llvm::any_of(NameList, [&Node](
const std::string &
Name) {
57 return llvm::Regex(Name).match(Node.getName());
65 #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)
bool isTriviallyDestructible(QualType Type)
Returns true if Type is trivially destructible.