10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_OWNING_MEMORY_H 11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_OWNING_MEMORY_H 13 #include "../ClangTidy.h" 17 namespace cppcoreguidelines {
28 LegacyResourceProducers(
Options.get(
29 "LegacyResourceProducers",
"::malloc;::aligned_alloc;::realloc;" 30 "::calloc;::fopen;::freopen;::tmpfile")),
31 LegacyResourceConsumers(
Options.get(
32 "LegacyResourceConsumers",
"::free;::realloc;::freopen;::fclose")) {
39 void check(
const ast_matchers::MatchFinder::MatchResult &Result)
override;
42 bool handleDeletion(
const ast_matchers::BoundNodes &Nodes);
43 bool handleLegacyConsumers(
const ast_matchers::BoundNodes &Nodes);
44 bool handleExpectedOwner(
const ast_matchers::BoundNodes &Nodes);
45 bool handleAssignmentAndInit(
const ast_matchers::BoundNodes &Nodes);
46 bool handleAssignmentFromNewOwner(
const ast_matchers::BoundNodes &Nodes);
47 bool handleReturnValues(
const ast_matchers::BoundNodes &Nodes);
48 bool handleOwnerMembers(
const ast_matchers::BoundNodes &Nodes);
53 const std::string LegacyResourceProducers;
56 const std::string LegacyResourceConsumers;
63 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_OWNING_MEMORY_H
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Match common cases, where the owner semantic is relevant, like function calls, delete expressions and...
Base class for all clang-tidy checks.
OwningMemoryCheck(StringRef Name, ClangTidyContext *Context)
Checks for common use cases for gsl::owner and enforces the unique owner nature of it whenever possib...
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Make configuration of checker discoverable.
std::map< std::string, std::string > OptionMap
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.