9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_NOT_NULL_TERMINATED_RESULT_H
10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_NOT_NULL_TERMINATED_RESULT_H
12#include "../ClangTidyCheck.h"
29 void check(
const ast_matchers::MatchFinder::MatchResult &Result)
override;
31 Preprocessor *ModuleExpanderPP)
override;
37 const bool WantToUseSafeFunctions;
39 bool UseSafeFunctions =
false;
41 void memoryHandlerFunctionFix(
42 StringRef
Name,
const ast_matchers::MatchFinder::MatchResult &Result);
43 void memcpyFix(StringRef
Name,
44 const ast_matchers::MatchFinder::MatchResult &Result,
45 DiagnosticBuilder &Diag);
46 void memcpy_sFix(StringRef
Name,
47 const ast_matchers::MatchFinder::MatchResult &Result,
48 DiagnosticBuilder &Diag);
49 void memchrFix(StringRef
Name,
50 const ast_matchers::MatchFinder::MatchResult &Result);
51 void memmoveFix(StringRef
Name,
52 const ast_matchers::MatchFinder::MatchResult &Result,
53 DiagnosticBuilder &Diag)
const;
54 void strerror_sFix(
const ast_matchers::MatchFinder::MatchResult &Result);
55 void ncmpFix(StringRef
Name,
56 const ast_matchers::MatchFinder::MatchResult &Result);
57 void xfrmFix(StringRef
Name,
58 const ast_matchers::MatchFinder::MatchResult &Result);
llvm::SmallString< 256U > Name
Base class for all clang-tidy checks.
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Finds function calls where it is possible to cause a not null-terminated result.
void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override
Override this to register PPCallbacks in the preprocessor.
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Should store all options supported by this check with their current values or default values for opti...
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
llvm::StringMap< ClangTidyValue > OptionMap