#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Checkers/Taint.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/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include <optional>
usingnamespaceclang;
usingnamespaceento;
usingnamespacetaint;
namespace {
class DivZeroChecker : public Checker<check::PreStmt<BinaryOperator>> { … };
}
static const Expr *getDenomExpr(const ExplodedNode *N) { … }
void DivZeroChecker::reportBug(StringRef Msg, ProgramStateRef StateZero,
CheckerContext &C) const { … }
void DivZeroChecker::reportTaintBug(
StringRef Msg, ProgramStateRef StateZero, CheckerContext &C,
llvm::ArrayRef<SymbolRef> TaintedSyms) const { … }
void DivZeroChecker::checkPreStmt(const BinaryOperator *B,
CheckerContext &C) const { … }
void ento::registerDivZeroChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterDivZeroChecker(const CheckerManager &mgr) { … }
void ento::registerTaintedDivChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterTaintedDivChecker(const CheckerManager &mgr) { … }