21 std::optional<bool> isUnsafeType(QualType QT)
const override {
24 std::optional<bool> isUnsafePtr(QualType QT,
bool)
const override {
30 bool isSafePtrType(QualType
T)
const override {
33 bool isPtrType(
const std::string &Name)
const override {
36 const char *typeName()
const override {
return "RefPtr-capable type"; }
41 std::optional<bool> isUnsafeType(QualType QT)
const override {
44 std::optional<bool> isUnsafePtr(QualType QT,
bool)
const override {
50 bool isSafePtrType(QualType
T)
const override {
53 bool isPtrType(
const std::string &Name)
const override {
56 bool isSafeExpr(
const Expr *E)
const override {
59 const char *typeName()
const override {
return "CheckedPtr-capable type"; }
63 mutable RetainTypeChecker RTC;
66 std::optional<bool> isUnsafeType(QualType QT)
const override {
67 return RTC.isUnretained(QT);
69 std::optional<bool> isUnsafePtr(QualType QT,
bool IgnoreARC)
const override {
70 return RTC.isUnretained(QT, IgnoreARC);
75 bool isSafePtrType(QualType
T)
const override {
78 bool isPtrType(
const std::string &Name)
const override {
81 bool isSafeDecl(
const Decl *D,
const SourceManager &
SM)
const override {
85 const char *typeName()
const override {
return "RetainPtr-capable type"; }
86 RetainTypeChecker *retainTypeChecker()
const override {
return &RTC; }
96 if (Model.retainTypeChecker() &&
T.hasStrongOrWeakObjCLifetime())
98 return Model.isUnsafePtr(
T, IgnoreARC);
102 return std::make_unique<RefCountedSafetyModel>();
106 return std::make_unique<CheckedPtrSafetyModel>();
110 return std::make_unique<RetainPtrSafetyModel>();
llvm::MachO::Record Record
Defines the SourceManager interface.
C Language Family Type Representation.
SourceLocation getLocation() const
Models one WebKit pointer-safety policy: ref-counted (RefPtr), checked (CheckedPtr),...
A (possibly-)qualified type.
QualType getCanonicalType() const
constexpr bool isPtrType(PrimType T)
The JSON file list parser is used to communicate input to InstallAPI.
bool isExprToGetCheckedPtrCapableMember(const clang::Expr *E)
std::optional< bool > isUnchecked(const QualType T)
bool isRefOrCheckedPtrType(const clang::QualType T)
std::unique_ptr< PtrRefSafetyModel > makeCheckedPtrSafetyModel()
bool isRetainPtrOrOSPtrType(const clang::QualType T)
std::optional< bool > isUnsafePtrForStorage(const PtrRefSafetyModel &Model, QualType T, bool IgnoreARC=false)
Applies the memory-management exemptions that hold for a variable, member, or lambda capture (but not...
const FunctionProtoType * T
bool isRefCounted(const CXXRecordDecl *R)
bool isRetainPtrOrOSPtr(const std::string &Name)
bool isRefType(const std::string &Name)
std::optional< bool > isUncountedPtr(const QualType T)
bool isSafePtr(clang::CXXRecordDecl *Decl)
bool isCheckedPtr(const std::string &Name)
std::unique_ptr< PtrRefSafetyModel > makeRefPtrSafetyModel()
std::unique_ptr< PtrRefSafetyModel > makeRetainPtrSafetyModel()
std::optional< bool > isUncounted(const QualType T)
std::optional< bool > isUncheckedPtr(const QualType T)