clang-tools  16.0.0git
TypeTraits.h
Go to the documentation of this file.
1 //===--- TypeTraits.h - clang-tidy-------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_TYPETRAITS_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_TYPETRAITS_H
11 
12 #include "clang/AST/ASTContext.h"
13 #include "clang/AST/Type.h"
14 
15 namespace clang {
16 namespace tidy {
17 namespace utils {
18 namespace type_traits {
19 
20 /// Returns `true` if `Type` is expensive to copy.
21 llvm::Optional<bool> isExpensiveToCopy(QualType Type,
22  const ASTContext &Context);
23 
24 /// Returns `true` if `Type` is trivially default constructible.
25 bool isTriviallyDefaultConstructible(QualType Type, const ASTContext &Context);
26 
27 /// Returns `true` if `RecordDecl` is trivially default constructible.
28 bool recordIsTriviallyDefaultConstructible(const RecordDecl &RecordDecl,
29  const ASTContext &Context);
30 
31 /// Returns `true` if `Type` is trivially destructible.
32 bool isTriviallyDestructible(QualType Type);
33 
34 /// Returns true if `Type` has a non-trivial move constructor.
35 bool hasNonTrivialMoveConstructor(QualType Type);
36 
37 /// Return true if `Type` has a non-trivial move assignment operator.
38 bool hasNonTrivialMoveAssignment(QualType Type);
39 
40 } // namespace type_traits
41 } // namespace utils
42 } // namespace tidy
43 } // namespace clang
44 
45 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_TYPETRAITS_H
clang::tidy::utils::type_traits::isTriviallyDestructible
bool isTriviallyDestructible(QualType Type)
Returns true if Type is trivially destructible.
Definition: TypeTraits.cpp:139
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:41
clang::tidy::utils::type_traits::isTriviallyDefaultConstructible
bool isTriviallyDefaultConstructible(QualType Type, const ASTContext &Context)
Returns true if Type is trivially default constructible.
Definition: TypeTraits.cpp:92
clang::tidy::utils::type_traits::hasNonTrivialMoveConstructor
bool hasNonTrivialMoveConstructor(QualType Type)
Returns true if Type has a non-trivial move constructor.
Definition: TypeTraits.cpp:152
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
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ApplyReplacements.h:27
clang::tidy::utils::type_traits::hasNonTrivialMoveAssignment
bool hasNonTrivialMoveAssignment(QualType Type)
Return true if Type has a non-trivial move assignment operator.
Definition: TypeTraits.cpp:158