clang-tools 22.0.0git
|
This checker is concerned with C-style memory management and suggest modern alternatives to it. More...
#include <NoMallocCheck.h>
Public Member Functions | |
NoMallocCheck (StringRef Name, ClangTidyContext *Context) | |
Construct Checker and read in configuration for function names. | |
bool | isLanguageVersionSupported (const LangOptions &LangOpts) const override |
void | storeOptions (ClangTidyOptions::OptionMap &Opts) override |
Make configuration of checker discoverable. | |
void | registerMatchers (ast_matchers::MatchFinder *Finder) override |
Registering for malloc, calloc, realloc and free calls. | |
void | check (const ast_matchers::MatchFinder::MatchResult &Result) override |
Checks matched function calls and gives suggestion to modernize the code. |
This checker is concerned with C-style memory management and suggest modern alternatives to it.
The check is only enabled in C++. For analyzing malloc calls see Clang Static Analyzer - unix.Malloc.
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/no-malloc.html
Definition at line 23 of file NoMallocCheck.h.
|
inline |
Construct Checker and read in configuration for function names.
Definition at line 26 of file NoMallocCheck.h.
|
override |
Checks matched function calls and gives suggestion to modernize the code.
Definition at line 46 of file NoMallocCheck.cpp.
|
inlineoverride |
Definition at line 32 of file NoMallocCheck.h.
|
override |
Registering for malloc, calloc, realloc and free calls.
Definition at line 24 of file NoMallocCheck.cpp.
References clang::tidy::utils::options::parseStringList().
|
override |
Make configuration of checker discoverable.
Definition at line 18 of file NoMallocCheck.cpp.