clang 24.0.0git
libc_func_matchers Namespace Reference

Functions

static StringRef matchLibcName (StringRef Name)
static StringRef matchLibcNameOrBuiltinChk (StringRef Name)
static StringRef matchName (StringRef FunName, bool isBuiltin)
static bool hasUnsafeFormatOrSArg (ASTContext &Ctx, const CallExpr *Call, const Expr *&UnsafeArg, const unsigned FmtIdx, std::optional< const unsigned > FmtArgIdx=std::nullopt, bool isKprintf=false)
static std::optional< UnsafeLibcFunctionFamily > getPredefinedUnsafeLibcFuncFamily (const FunctionDecl &Node)
static bool isPredefinedUnsafeLibcFunc (const FunctionDecl &Node)
static UnsafeLibcFunctionFamily getUnsafeLibcFunctionFamily (const FunctionDecl &Node)
static bool isUnsafeMemset (const CallExpr &Node, ASTContext &Ctx)
static bool isUnsafeVaListPrintfFunc (const FunctionDecl &Node)
static bool isUnsafeSprintfFunc (const FunctionDecl &Node)
static bool isNormalPrintfFunc (const FunctionDecl &Node)
static bool hasUnsafePrintfStringArg (const CallExpr &Node, ASTContext &Ctx, MatchResult &Result, llvm::StringRef Tag)
static bool hasUnsafeSnprintfBuffer (const CallExpr &Node, ASTContext &Ctx)
static bool isInLibcScope (const FunctionDecl &FD)
static bool isLibcFunction (const FunctionDecl &FD)

Function Documentation

◆ getPredefinedUnsafeLibcFuncFamily()

◆ getUnsafeLibcFunctionFamily()

UnsafeLibcFunctionFamily libc_func_matchers::getUnsafeLibcFunctionFamily ( const FunctionDecl & Node)
static

◆ hasUnsafeFormatOrSArg()

◆ hasUnsafePrintfStringArg()

◆ hasUnsafeSnprintfBuffer()

◆ isInLibcScope()

◆ isLibcFunction()

bool libc_func_matchers::isLibcFunction ( const FunctionDecl & FD)
static

◆ isNormalPrintfFunc()

bool libc_func_matchers::isNormalPrintfFunc ( const FunctionDecl & Node)
static

◆ isPredefinedUnsafeLibcFunc()

bool libc_func_matchers::isPredefinedUnsafeLibcFunc ( const FunctionDecl & Node)
static

◆ isUnsafeMemset()

◆ isUnsafeSprintfFunc()

bool libc_func_matchers::isUnsafeSprintfFunc ( const FunctionDecl & Node)
static

◆ isUnsafeVaListPrintfFunc()

bool libc_func_matchers::isUnsafeVaListPrintfFunc ( const FunctionDecl & Node)
static

◆ matchLibcName()

StringRef libc_func_matchers::matchLibcName ( StringRef Name)
static

Definition at line 973 of file UnsafeBufferUsage.cpp.

Referenced by matchLibcNameOrBuiltinChk(), and matchName().

◆ matchLibcNameOrBuiltinChk()

StringRef libc_func_matchers::matchLibcNameOrBuiltinChk ( StringRef Name)
static

Definition at line 981 of file UnsafeBufferUsage.cpp.

References matchLibcName().

Referenced by matchName().

◆ matchName()

StringRef libc_func_matchers::matchName ( StringRef FunName,
bool isBuiltin )
static