#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/Checker.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h"
#include "llvm/Support/Debug.h"
usingnamespaceclang;
usingnamespaceento;
usingnamespaceast_matchers;
namespace {
static constexpr const char *const WarnAtNode = …;
static constexpr const char *const WarnRecordDecl = …;
class OSObjectCStyleCastChecker : public Checker<check::ASTCodeBody> { … };
}
namespace clang {
namespace ast_matchers {
AST_MATCHER_P(StringLiteral, mentionsBoundType, std::string, BindingID) { … }
}
}
static void emitDiagnostics(const BoundNodes &Nodes,
BugReporter &BR,
AnalysisDeclContext *ADC,
const OSObjectCStyleCastChecker *Checker) { … }
static decltype(auto) hasTypePointingTo(DeclarationMatcher DeclM) { … }
void OSObjectCStyleCastChecker::checkASTCodeBody(const Decl *D,
AnalysisManager &AM,
BugReporter &BR) const { … }
void ento::registerOSObjectCStyleCast(CheckerManager &Mgr) { … }
bool ento::shouldRegisterOSObjectCStyleCast(const CheckerManager &mgr) { … }