#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/BugReporter/CommonBugCategories.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h"
#include "llvm/ADT/Twine.h"
usingnamespaceclang;
usingnamespaceento;
usingnamespaceast_matchers;
namespace {
const char *ProblematicWriteBind = …;
const char *CapturedBind = …;
const char *ParamBind = …;
const char *IsMethodBind = …;
const char *IsARPBind = …;
class ObjCAutoreleaseWriteChecker : public Checker<check::ASTCodeBody> { … };
}
static inline std::vector<llvm::StringRef>
toRefs(const std::vector<std::string> &V) { … }
static decltype(auto)
callsNames(const std::vector<std::string> &FunctionNames) { … }
static void emitDiagnostics(BoundNodes &Match, const Decl *D, BugReporter &BR,
AnalysisManager &AM,
const ObjCAutoreleaseWriteChecker *Checker) { … }
void ObjCAutoreleaseWriteChecker::checkASTCodeBody(const Decl *D,
AnalysisManager &AM,
BugReporter &BR) const { … }
void ento::registerAutoreleaseWriteChecker(CheckerManager &Mgr) { … }
bool ento::shouldRegisterAutoreleaseWriteChecker(const CheckerManager &mgr) { … }