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