32class NSAutoreleasePoolChecker
33 :
public Checker<check::PreObjCMessage> {
34 mutable std::unique_ptr<BugType> BT;
43void NSAutoreleasePoolChecker::checkPreObjCMessage(
const ObjCMethodCall &msg,
54 if (releaseS.isNull())
61 BT.reset(
new BugType(
this,
"Use -drain instead of -release",
62 "API Upgrade (Apple)"));
70 auto Report = std::make_unique<PathSensitiveBugReport>(
72 "Use -drain instead of -release when using NSAutoreleasePool and "
76 C.emitReport(std::move(Report));
83bool ento::shouldRegisterNSAutoreleasePoolChecker(
const CheckerManager &mgr) {
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
Selector GetNullarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing a nullary selector.