9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_OWNING_MEMORY_H 10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_OWNING_MEMORY_H 12 #include "../ClangTidy.h" 16 namespace cppcoreguidelines {
27 LegacyResourceProducers(
Options.get(
28 "LegacyResourceProducers",
"::malloc;::aligned_alloc;::realloc;" 29 "::calloc;::fopen;::freopen;::tmpfile")),
30 LegacyResourceConsumers(
Options.get(
31 "LegacyResourceConsumers",
"::free;::realloc;::freopen;::fclose")) {
38 void check(
const ast_matchers::MatchFinder::MatchResult &
Result)
override;
41 bool handleDeletion(
const ast_matchers::BoundNodes &Nodes);
42 bool handleLegacyConsumers(
const ast_matchers::BoundNodes &Nodes);
43 bool handleExpectedOwner(
const ast_matchers::BoundNodes &Nodes);
44 bool handleAssignmentAndInit(
const ast_matchers::BoundNodes &Nodes);
45 bool handleAssignmentFromNewOwner(
const ast_matchers::BoundNodes &Nodes);
46 bool handleReturnValues(
const ast_matchers::BoundNodes &Nodes);
47 bool handleOwnerMembers(
const ast_matchers::BoundNodes &Nodes);
52 const std::string LegacyResourceProducers;
55 const std::string LegacyResourceConsumers;
62 #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...
static constexpr llvm::StringLiteral Name
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.
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result