25class ObjCPropertyChecker
26 :
public Checker<check::ASTDecl<ObjCPropertyDecl>> {
38 checkCopyMutable(
D, BR);
53 if (!StringRef(PropTypeName).starts_with(
"NSMutable"))
59 ImplD = IntD->getImplementation();
60 }
else if (
auto *CatD = dyn_cast<ObjCCategoryDecl>(
D->
getDeclContext())) {
68 llvm::raw_svector_ostream OS(Str);
69 OS <<
"Property of mutable type '" << PropTypeName
70 <<
"' has 'copy' attribute; an immutable object will be stored instead";
73 D,
this,
"Objective-C property misuse",
"Logic error", OS.str(),
82bool ento::shouldRegisterObjCPropertyChecker(
const CheckerManager &mgr) {
DeclContext * getDeclContext()
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
bool HasUserDeclaredSetterMethod(const ObjCPropertyDecl *P) const
This routine returns 'true' if a user declared setter method was found in the class,...
const ObjCInterfaceDecl * getClassInterface() const
Represents an ObjC class declaration.
ObjCImplementationDecl * getImplementation() const
Represents one property declaration in an Objective-C interface.
A (possibly-)qualified type.
QualType getCanonicalType() const
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
static std::string getAsString(SplitQualType split, const PrintingPolicy &Policy)
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
bool isObjCObjectPointerType() const
BugReporter is a utility class for generating PathDiagnostics for analysis.
const SourceManager & getSourceManager()
void EmitBasicReport(const Decl *DeclWithIssue, const CheckerBase *Checker, StringRef BugName, StringRef BugCategory, StringRef BugStr, PathDiagnosticLocation Loc, ArrayRef< SourceRange > Ranges=std::nullopt, ArrayRef< FixItHint > Fixits=std::nullopt)
CHECKER * registerChecker(AT &&... Args)
Used to register checkers.
static PathDiagnosticLocation createBegin(const Decl *D, const SourceManager &SM)
Create a location for the beginning of the declaration.
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T