clang-tools  7.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
bool hasNonTrivialMoveConstructor(QualType Type)
Returns true if Type has a non-trivial move constructor.
Definition: TypeTraits.cpp:135
bool recordIsTriviallyDefaultConstructible(const RecordDecl &RecordDecl, const ASTContext &Context)
Returns true if RecordDecl is trivially default constructible.
Definition: TypeTraits.cpp:52
llvm::Optional< bool > isExpensiveToCopy(QualType Type, const ASTContext &Context)
Returns true if Type is expensive to copy.
Definition: TypeTraits.cpp:42
bool isTriviallyDefaultConstructible(QualType Type, const ASTContext &Context)
Returns true if Type is trivially default constructible.
Definition: TypeTraits.cpp:89
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
bool hasNonTrivialMoveAssignment(QualType Type)
Return true if Type has a non-trivial move assignment operator.
Definition: TypeTraits.cpp:141