9#ifndef LLVM_CLANG_ANALYZER_WEBKIT_PTRTYPESEMANTICS_H
10#define LLVM_CLANG_ANALYZER_WEBKIT_PTRTYPESEMANTICS_H
12#include "llvm/ADT/APInt.h"
13#include "llvm/ADT/DenseMap.h"
14#include "llvm/ADT/DenseSet.h"
15#include "llvm/ADT/PointerUnion.h"
16#include "llvm/ADT/SmallVector.h"
45std::optional<const clang::CXXRecordDecl *>
47 llvm::StringRef NameToMatch);
113 llvm::DenseMap<const RecordType *, const TypedefDecl *> CFPointees;
114 llvm::DenseSet<const Type *> RecordlessTypes;
115 bool IsARCEnabled{
false};
116 bool DefaultSynthProperties{
true};
176bool isBorrow(
const std::string &Name);
250 return hasTrivialDtorImpl(VD, TheCache);
253 return fieldWithNonTrivialCtorImpl(RD, TheCache);
256 return fieldWithNonTrivialDtorImpl(RD, TheCache);
268 llvm::DenseMap<llvm::PointerUnion<const Decl *, const Stmt *>,
bool>;
269 mutable CacheTy TheCache{};
271 static bool isTrivialImpl(
const Decl *D, CacheTy &
Cache);
272 static bool isTrivialImpl(
const Stmt *S, CacheTy &
Cache);
273 static bool hasTrivialDtorImpl(
const VarDecl *VD, CacheTy &
Cache);
Represents a base class of a C++ class.
Represents a static or instance method of a struct/union/class.
Represents a C++ struct/union/class.
Decl - This represents one declaration (or definition), e.g.
Represents a member of a struct/union/class.
Represents a function declaration or definition.
This represents a decl that may have a name.
A (possibly-)qualified type.
An inter-procedural analysis facility that detects CF types with the underlying pointer type.
const TypedefDecl * getCanonicalDecl(QualType)
bool defaultSynthProperties() const
bool isUnretained(const QualType, bool ignoreARC=false)
void visitTranslationUnitDecl(const TranslationUnitDecl *)
bool isARCEnabled() const
void visitTypedef(const TypedefDecl *)
Stmt - This represents one statement.
The top declaration context.
An inter-procedural analysis facility that detects functions with "trivial" behavior with respect to ...
friend class TrivialFunctionAnalysisVisitor
bool isTrivial(const Stmt *S) const
const FieldDecl * fieldWithNonTrivialDtor(const CXXRecordDecl *RD) const
static NonTrivialityReason computeReason(const Stmt *S)
bool hasTrivialDtor(const VarDecl *VD) const
const FieldDecl * fieldWithNonTrivialCtor(const CXXRecordDecl *RD) const
bool isTrivial(const Decl *D) const
The base class of the type hierarchy.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Represents a variable declaration or definition.
Top level wrappers for InstallAPI frontend operations.
bool isCtorOfSafePtr(const clang::FunctionDecl *F)
bool isTrivialBuiltinFunction(const FunctionDecl *F)
bool isPtrConversion(const FunctionDecl *F)
QualType pointeeType(QualType T)
std::optional< bool > isCheckedPtrCapable(const clang::CXXRecordDecl *R)
std::optional< bool > isUnchecked(const QualType T)
QualType borrowedType(QualType T)
bool isCtorOfRefCounted(const clang::FunctionDecl *F)
bool isRefOrCheckedPtrType(const clang::QualType T)
bool isView(const clang::QualType T)
bool isRetainPtrOrOSPtrType(const clang::QualType T)
bool isGetterOfUniquePtr(const CXXMethodDecl *M)
bool isBorrow(const clang::CXXRecordDecl *R)
std::optional< bool > isBorrowable(const clang::CXXRecordDecl *R)
bool isOwnerPtr(const std::string &Name)
bool isStdView(const clang::CXXRecordDecl *R)
const FunctionProtoType * T
std::optional< bool > isRefCountable(const clang::CXXRecordDecl *R)
std::optional< const clang::CXXRecordDecl * > hasPublicMethodInBase(const CXXBaseSpecifier *Base, StringRef NameToMatch)
bool isSmartPtrClass(const std::string &Name)
bool isRefCounted(const CXXRecordDecl *R)
bool isNoDeleteFunction(const FunctionDecl *F)
bool isOwnerPtrType(const clang::QualType T)
bool isSmartPtr(const CXXRecordDecl *R)
std::optional< bool > isGetterOfSafePtr(const CXXMethodDecl *M)
bool isRetainPtrOrOSPtr(const std::string &Name)
bool isRefType(const std::string &Name)
bool isUniquePtr(const std::string &Name)
std::optional< bool > isUncountedPtr(const QualType T)
bool isCtorOfCheckedPtr(const clang::FunctionDecl *F)
bool isSingleton(const NamedDecl *F)
bool isCheckedPtr(const std::string &Name)
bool isStdOrWTFMove(const clang::FunctionDecl *F)
bool isBorrowType(const clang::QualType T)
@ Class
The "class" keyword introduces the elaborated-type-specifier.
std::optional< bool > isUncounted(const QualType T)
std::optional< bool > isUncheckedPtr(const QualType T)
bool isWeakPtr(const CXXRecordDecl *R)
One function in the chain of calls that leads from OffendingStmt to the code that could destruct an o...
const Stmt * OffendingStmt
The innermost non-trivial statement inside Callee's body.
const FunctionDecl * Callee
Explains why TrivialFunctionAnalysis rejected a statement, so that a diagnostic can blame the code th...
const Stmt * OffendingStmt
The innermost non-trivial statement inside the analyzed function's own body.
llvm::SmallVector< Frame > CallStack
The callees that could not be proven free of destruction, outermost first: the first frame is called ...