10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_SMART_PTR_H 11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_SMART_PTR_H 13 #include "../ClangTidy.h" 14 #include "../utils/IncludeInserter.h" 15 #include "clang/ASTMatchers/ASTMatchFinder.h" 16 #include "clang/ASTMatchers/ASTMatchersInternal.h" 17 #include "llvm/ADT/StringRef.h" 28 StringRef MakeSmartPtrFunctionName);
31 void check(
const ast_matchers::MatchFinder::MatchResult &
Result)
final;
49 std::unique_ptr<utils::IncludeInserter> Inserter;
51 const std::string MakeSmartPtrFunctionHeader;
52 const std::string MakeSmartPtrFunctionName;
53 const bool IgnoreMacros;
55 void checkConstruct(SourceManager &SM, ASTContext *
Ctx,
56 const CXXConstructExpr *Construct,
const QualType *Type,
57 const CXXNewExpr *New);
58 void checkReset(SourceManager &SM, ASTContext *
Ctx,
59 const CXXMemberCallExpr *Member,
const CXXNewExpr *New);
62 bool replaceNew(DiagnosticBuilder &Diag,
const CXXNewExpr *New,
63 SourceManager &SM, ASTContext *
Ctx);
64 void insertHeader(DiagnosticBuilder &Diag, FileID FD);
71 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_SMART_PTR_H ast_matchers::internal::BindableMatcher< QualType > SmartPtrTypeMatcher
virtual bool isLanguageVersionSupported(const LangOptions &LangOpts) const
Returns whether the C++ version is compatible with current check.
IncludeStyle
Supported include styles.
void registerMatchers(ast_matchers::MatchFinder *Finder) final
Override this to register AST matchers with Finder.
Base class for all clang-tidy checks.
void registerPPCallbacks(clang::CompilerInstance &Compiler) override
virtual SmartPtrTypeMatcher getSmartPointerTypeMatcher() const =0
Returns matcher that match with different smart pointer types.
void check(const ast_matchers::MatchFinder::MatchResult &Result) final
ClangTidyChecks that register ASTMatchers should do the actual work in here.
static constexpr llvm::StringLiteral Name
std::map< std::string, std::string > OptionMap
static const char PointerType[]
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Should store all options supported by this check with their current values or default values for opti...
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Base class for MakeSharedCheck and MakeUniqueCheck.
MakeSmartPtrCheck(StringRef Name, ClangTidyContext *Context, StringRef MakeSmartPtrFunctionName)