#include "clang/Basic/Builtins.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Checkers/Taint.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicExtent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
usingnamespaceclang;
usingnamespaceento;
usingnamespacetaint;
namespace {
QualType getSufficientTypeForOverflowOp(CheckerContext &C, const QualType &T) { … }
QualType getOverflowBuiltinResultType(const CallEvent &Call) { … }
QualType getOverflowBuiltinResultType(const CallEvent &Call, CheckerContext &C,
unsigned BI) { … }
class BuiltinFunctionChecker : public Checker<eval::Call> { … };
}
const NoteTag *BuiltinFunctionChecker::createBuiltinNoOverflowNoteTag(
CheckerContext &C, bool BothFeasible, SVal Arg1, SVal Arg2,
SVal Result) const { … }
const NoteTag *
BuiltinFunctionChecker::createBuiltinOverflowNoteTag(CheckerContext &C) const { … }
std::pair<bool, bool>
BuiltinFunctionChecker::checkOverflow(CheckerContext &C, SVal RetVal,
QualType Res) const { … }
void BuiltinFunctionChecker::handleOverflowBuiltin(const CallEvent &Call,
CheckerContext &C,
BinaryOperator::Opcode Op,
QualType ResultType) const { … }
bool BuiltinFunctionChecker::isBuiltinLikeFunction(
const CallEvent &Call) const { … }
bool BuiltinFunctionChecker::evalCall(const CallEvent &Call,
CheckerContext &C) const { … }
void ento::registerBuiltinFunctionChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterBuiltinFunctionChecker(const CheckerManager &mgr) { … }