clang-tools 3.8.0

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

Matchers.h
Go to the documentation of this file.
1 //===--- Matchers.h - clang-tidy-------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_MATCHERS_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_MATCHERS_H
12
13 #include "clang/ASTMatchers/ASTMatchers.h"
14 #include "TypeTraits.h"
15
16 namespace clang {
17 namespace tidy {
18 namespace matchers {
19
20 AST_MATCHER(QualType, isExpensiveToCopy) {
21 llvm::Optional<bool> IsExpensive =
22 type_traits::isExpensiveToCopy(Node, Finder->getASTContext());
23 return IsExpensive && *IsExpensive;
24 }
25
26 } // namespace matchers
27 } // namespace tidy
28 } // namespace clang
29
30 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_MATCHERS_H
TypeTraits.h
Finder
std::unique_ptr< ast_matchers::MatchFinder > Finder
Definition: ClangTidy.cpp:188
clang::tidy::matchers::AST_MATCHER
AST_MATCHER(QualType, isExpensiveToCopy)
Definition: Matchers.h:20
clang::tidy::type_traits::isExpensiveToCopy
llvm::Optional< bool > isExpensiveToCopy(QualType Type, ASTContext &Context)
Definition: TypeTraits.cpp:27