32class NSAutoreleasePoolChecker
33 :
public Checker<check::PreObjCMessage> {
34 const BugType BT{
this,
"Use -drain instead of -release",
35 "API Upgrade (Apple)"};
44void NSAutoreleasePoolChecker::checkPreObjCMessage(
const ObjCMethodCall &msg,
55 if (releaseS.isNull())
67 auto Report = std::make_unique<PathSensitiveBugReport>(
69 "Use -drain instead of -release when using NSAutoreleasePool and "
73 C.emitReport(std::move(Report));
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.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
Represents an ObjC class declaration.
Smart pointer class that efficiently represents Objective-C method names.
CHECKER * registerChecker(AT &&... Args)
Used to register checkers.
const LangOptions & getLangOpts() const
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.