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

//== ReturnUndefChecker.cpp -------------------------------------*- 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 file defines ReturnUndefChecker, which is a path-sensitive
// check which looks for undefined or garbage values being returned to the
// caller.
//
//===----------------------------------------------------------------------===//

#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"

usingnamespaceclang;
usingnamespaceento;

namespace {
class ReturnUndefChecker : public Checker< check::PreStmt<ReturnStmt> > {};
}

void ReturnUndefChecker::checkPreStmt(const ReturnStmt *RS,
                                      CheckerContext &C) const {}

static void emitBug(CheckerContext &C, const BugType &BT, StringRef Msg,
                    const Expr *RetE, const Expr *TrackingE = nullptr) {}

void ReturnUndefChecker::emitUndef(CheckerContext &C, const Expr *RetE) const {}

void ReturnUndefChecker::checkReference(CheckerContext &C, const Expr *RetE,
                                        DefinedOrUnknownSVal RetVal) const {}

void ento::registerReturnUndefChecker(CheckerManager &mgr) {}

bool ento::shouldRegisterReturnUndefChecker(const CheckerManager &mgr) {}