#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/raw_ostream.h"
usingnamespaceclang;
usingnamespaceento;
static bool IsLLVMStringRef(QualType T) { … }
static bool InNamespace(const Decl *D, StringRef NS) { … }
static bool IsStdString(QualType T) { … }
static bool IsClangType(const RecordDecl *RD) { … }
static bool IsClangDecl(const RecordDecl *RD) { … }
static bool IsClangStmt(const RecordDecl *RD) { … }
static bool IsClangAttr(const RecordDecl *RD) { … }
static bool IsStdVector(QualType T) { … }
static bool IsSmallVector(QualType T) { … }
namespace {
class StringRefCheckerVisitor : public StmtVisitor<StringRefCheckerVisitor> { … };
}
static void CheckStringRefAssignedTemporary(const Decl *D, BugReporter &BR,
const CheckerBase *Checker) { … }
void StringRefCheckerVisitor::VisitDeclStmt(DeclStmt *S) { … }
void StringRefCheckerVisitor::VisitVarDecl(VarDecl *VD) { … }
static bool AllocatesMemory(QualType T) { … }
static bool IsPartOfAST(const CXXRecordDecl *R) { … }
namespace {
class ASTFieldVisitor { … };
}
static void CheckASTMemory(const CXXRecordDecl *R, BugReporter &BR,
const CheckerBase *Checker) { … }
void ASTFieldVisitor::Visit(FieldDecl *D) { … }
void ASTFieldVisitor::ReportError(QualType T) { … }
namespace {
class LLVMConventionsChecker : public Checker<
check::ASTDecl<CXXRecordDecl>,
check::ASTCodeBody > { … };
}
void ento::registerLLVMConventionsChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterLLVMConventionsChecker(const CheckerManager &mgr) { … }