9#ifndef LLVM_CLANG_ANALYZER_WEBKIT_RAWPTRREFSAFETYMODEL_H
10#define LLVM_CLANG_ANALYZER_WEBKIT_RAWPTRREFSAFETYMODEL_H
15#include "llvm/Support/raw_ostream.h"
47 bool IgnoreARC =
false)
const = 0;
57 virtual bool isPtrType(
const std::string &Name)
const = 0;
62 virtual bool isSafeExpr(
const Expr *,
bool PtrIsLifetimeBoundToOrigin)
const {
97 Os <<
"raw " << (IsPtr ?
"pointer" :
"reference") <<
" to ";
112 QualType T,
bool IgnoreARC =
false);
llvm::MachO::Record Record
C Language Family Type Representation.
Represents a C++ struct/union/class.
Decl - This represents one declaration (or definition), e.g.
This represents one expression.
Models one WebKit pointer-safety policy: ref-counted (RefPtr), checked (CheckedPtr),...
virtual bool isSafeExpr(const Expr *, bool PtrIsLifetimeBoundToOrigin) const
virtual ~PtrRefSafetyModel()=default
virtual std::optional< bool > isUnsafePtr(QualType QT, bool IgnoreARC=false) const =0
virtual bool checksForInteriorDestruction() const
virtual std::optional< bool > isUnsafeType(QualType QT) const =0
virtual RetainTypeChecker * retainTypeChecker() const
virtual bool recognizesIndirectStores() const
virtual bool isSafePtr(const CXXRecordDecl *Record) const =0
virtual const char * typeName() const =0
virtual bool isSafeDecl(const Decl *, const SourceManager &) const
virtual bool isSafePtrType(QualType T) const =0
virtual bool isPtrType(const std::string &Name) const =0
virtual void describeHazard(llvm::raw_ostream &Os, const Expr *, QualType SinkType) const
Prints a phrase describing why the reported value is unsafe, completing a sentence of the form "Local...
A (possibly-)qualified type.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
An inter-procedural analysis facility that detects CF types with the underlying pointer type.
This class handles loading and caching of source files into memory.
const Type * getUnqualifiedDesugaredType() const
Return the specified type with any "sugar" removed from the type, removing any typedefs,...
Top level wrappers for InstallAPI frontend operations.
bool isa(CodeGen::Address addr)
std::unique_ptr< PtrRefSafetyModel > makeBorrowSafetyModel()
std::unique_ptr< PtrRefSafetyModel > makeCheckedPtrSafetyModel()
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
void printTypeName(llvm::raw_ostream &Os, const QualType QT)
std::unique_ptr< PtrRefSafetyModel > makeRefPtrSafetyModel()
std::unique_ptr< PtrRefSafetyModel > makeRetainPtrSafetyModel()