10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_NO_MALLOC_H 11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_NO_MALLOC_H 13 #include "../ClangTidy.h" 14 #include "clang/AST/ASTContext.h" 15 #include "clang/ASTMatchers/ASTMatchFinder.h" 19 namespace cppcoreguidelines {
33 AllocList(
Options.get(
"Allocations",
"::malloc;::calloc")),
34 ReallocList(
Options.get(
"Reallocations",
"::realloc")),
35 DeallocList(
Options.get(
"Deallocations",
"::free")) {}
44 void check(
const ast_matchers::MatchFinder::MatchResult &
Result)
override;
49 const std::string AllocList;
52 const std::string ReallocList;
55 const std::string DeallocList;
62 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_NO_MALLOC_H NoMallocCheck(StringRef Name, ClangTidyContext *Context)
Construct Checker and read in configuration for function names.
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Make configuration of checker discoverable.
This checker is concerned with C-style memory management and suggest modern alternatives to it...
Base class for all clang-tidy checks.
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
Checks matched function calls and gives suggestion to modernize the code.
static constexpr llvm::StringLiteral Name
std::map< std::string, std::string > OptionMap
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Registering for malloc, calloc, realloc and free calls.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.