#include "clang/AST/StmtVisitor.h"
#include "clang/AST/TypeLoc.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/raw_ostream.h"
usingnamespaceclang;
usingnamespaceento;
namespace {
TypeCallPair;
ExprParent;
class CastedAllocFinder
: public ConstStmtVisitor<CastedAllocFinder, TypeCallPair> { … };
class SizeofFinder : public ConstStmtVisitor<SizeofFinder> { … };
static bool typesCompatible(ASTContext &C, QualType A, QualType B) { … }
static bool compatibleWithArrayType(ASTContext &C, QualType PT, QualType T) { … }
class MallocSizeofChecker : public Checker<check::ASTCodeBody> { … };
}
void ento::registerMallocSizeofChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterMallocSizeofChecker(const CheckerManager &mgr) { … }