32class NSAutoreleasePoolChecker
33 :
public Checker<check::PreObjCMessage> {
34 const BugType BT{
this,
"Use -drain instead of -release",
35 "API Upgrade (Apple)"};
36 mutable Selector releaseS;
39 void checkPreObjCMessage(
const ObjCMethodCall &msg, CheckerContext &
C)
const;
44void NSAutoreleasePoolChecker::checkPreObjCMessage(
const ObjCMethodCall &msg,
61 ExplodedNode *N =
C.generateNonFatalErrorNode();
67 auto Report = std::make_unique<PathSensitiveBugReport>(
69 "Use -drain instead of -release when using NSAutoreleasePool and "
73 C.emitReport(std::move(
Report));
76void ento::registerNSAutoreleasePoolChecker(CheckerManager &mgr) {
80bool ento::shouldRegisterNSAutoreleasePoolChecker(
const CheckerManager &mgr) {
82 return LO.getGC() != LangOptions::NonGC;
bool isStr(const char(&Str)[StrLen]) const
Return true if this is the identifier for the specified string.
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
bool isNull() const
Determine whether this is the empty selector.
CHECKER * registerChecker(AT &&...Args)
Register a single-part checker (derived from Checker): construct its singleton instance,...
const LangOptions & getLangOpts() const
Simple checker classes that implement one frontend (i.e.
Represents any expression that calls an Objective-C method.
bool isInstanceMessage() const
SourceRange getSourceRange() const override
Returns a source range for the entire call, suitable for outputting in diagnostics.
const ObjCInterfaceDecl * getReceiverInterface() const
Get the interface for the receiver.
Selector getSelector() const
The JSON file list parser is used to communicate input to InstallAPI.
Selector GetNullarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing a nullary selector.