#include "../utils/TypeTraits.h"
#include "MakeSharedCheck.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Lex/Lexer.h"
#include "clang/Lex/Preprocessor.h"
usingnamespaceclang::ast_matchers;
namespace clang::tidy::modernize {
namespace {
constexpr char ConstructorCall[] = …;
constexpr char ResetCall[] = …;
constexpr char NewExpression[] = …;
std::string getNewExprName(const CXXNewExpr *NewExpr, const SourceManager &SM,
const LangOptions &Lang) { … }
}
const char MakeSmartPtrCheck::PointerType[] = …;
MakeSmartPtrCheck::MakeSmartPtrCheck(StringRef Name, ClangTidyContext *Context,
StringRef MakeSmartPtrFunctionName)
: … { … }
void MakeSmartPtrCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { … }
bool MakeSmartPtrCheck::isLanguageVersionSupported(
const LangOptions &LangOpts) const { … }
void MakeSmartPtrCheck::registerPPCallbacks(const SourceManager &SM,
Preprocessor *PP,
Preprocessor *ModuleExpanderPP) { … }
void MakeSmartPtrCheck::registerMatchers(ast_matchers::MatchFinder *Finder) { … }
void MakeSmartPtrCheck::check(const MatchFinder::MatchResult &Result) { … }
void MakeSmartPtrCheck::checkConstruct(SourceManager &SM, ASTContext *Ctx,
const CXXConstructExpr *Construct,
const QualType *Type,
const CXXNewExpr *New) { … }
void MakeSmartPtrCheck::checkReset(SourceManager &SM, ASTContext *Ctx,
const CXXMemberCallExpr *Reset,
const CXXNewExpr *New) { … }
bool MakeSmartPtrCheck::replaceNew(DiagnosticBuilder &Diag,
const CXXNewExpr *New, SourceManager &SM,
ASTContext *Ctx) { … }
void MakeSmartPtrCheck::insertHeader(DiagnosticBuilder &Diag, FileID FD) { … }
}