llvm/clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp

//== DivZeroChecker.cpp - Division by zero checker --------------*- C++ -*--==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This defines DivZeroChecker, a builtin check in ExprEngine that performs
// checks for division by zeros.
//
//===----------------------------------------------------------------------===//

#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>> {};
} // end anonymous namespace

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) {}