clang-tools 6.0.0

TypeTraits.h
Go to the documentation of this file.
1 //===--- TypeTraits.h - clang-tidy-------------------------------*- C++ -*-===//
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_TYPETRAITS_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_TYPETRAITS_H
12
13 #include "clang/AST/ASTContext.h"
14 #include "clang/AST/Type.h"
15
16 namespace clang {
17 namespace tidy {
18 namespace utils {
19 namespace type_traits {
20
21 /// Returns `true` if `Type` is expensive to copy.
22 llvm::Optional<bool> isExpensiveToCopy(QualType Type,
23 const ASTContext &Context);
24
25 /// Returns `true` if `Type` is trivially default constructible.
26 bool isTriviallyDefaultConstructible(QualType Type, const ASTContext &Context);
27
28 /// Returns `true` if `RecordDecl` is trivially default constructible.
29 bool recordIsTriviallyDefaultConstructible(const RecordDecl &RecordDecl,
30 const ASTContext &Context);
31
32 /// Returns true if `Type` has a non-trivial move constructor.
33 bool hasNonTrivialMoveConstructor(QualType Type);
34
35 /// Return true if `Type` has a non-trivial move assignment operator.
36 bool hasNonTrivialMoveAssignment(QualType Type);
37
38 } // type_traits
39 } // namespace utils
40 } // namespace tidy
41 } // namespace clang
42
43 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_TYPETRAITS_H
clang::tidy::utils::type_traits::hasNonTrivialMoveConstructor
bool hasNonTrivialMoveConstructor(QualType Type)
Returns true if Type has a non-trivial move constructor.
Definition: TypeTraits.cpp:134
clang::tidy::utils::type_traits::recordIsTriviallyDefaultConstructible
bool recordIsTriviallyDefaultConstructible(const RecordDecl &RecordDecl, const ASTContext &Context)
Returns true if RecordDecl is trivially default constructible.
Definition: TypeTraits.cpp:51
clang::tidy::utils::type_traits::isExpensiveToCopy
llvm::Optional< bool > isExpensiveToCopy(QualType Type, const ASTContext &Context)
Returns true if Type is expensive to copy.
Definition: TypeTraits.cpp:42
clang::tidy::utils::type_traits::isTriviallyDefaultConstructible
bool isTriviallyDefaultConstructible(QualType Type, const ASTContext &Context)
Returns true if Type is trivially default constructible.
Definition: TypeTraits.cpp:88
clang
Definition: AndroidTidyModule.cpp:28
clang::tidy::utils::type_traits::hasNonTrivialMoveAssignment
bool hasNonTrivialMoveAssignment(QualType Type)
Return true if Type has a non-trivial move assignment operator.
Definition: TypeTraits.cpp:140