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;
52 std::unique_ptr<utils::IncludeInserter> Inserter;
54 const std::string MakeSmartPtrFunctionHeader;
55 const std::string MakeSmartPtrFunctionName;
56 const bool IgnoreMacros;
58 void checkConstruct(SourceManager &SM,
const CXXConstructExpr *Construct,
59 const QualType *Type,
const CXXNewExpr *New);
60 void checkReset(SourceManager &SM,
const CXXMemberCallExpr *Member,
61 const CXXNewExpr *New);
64 bool replaceNew(DiagnosticBuilder &Diag,
const CXXNewExpr *New,
66 void insertHeader(DiagnosticBuilder &Diag, FileID FD);
73 #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.
static const char ConstructorCall[]
void check(const ast_matchers::MatchFinder::MatchResult &Result) final
ClangTidyChecks that register ASTMatchers should do the actual work in here.
std::map< std::string, std::string > OptionMap
static const char PointerType[]
===– 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)
static const char NewExpression[]
static const char ResetCall[]