#include "UseStdMinMaxCheck.h"
#include "../utils/ASTUtils.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Lex/Preprocessor.h"
usingnamespaceclang::ast_matchers;
namespace clang::tidy::readability {
namespace {
AST_MATCHER(IfStmt, isIfInMacro) { … }
}
static const llvm::StringRef AlgorithmHeader("<algorithm>");
static bool minCondition(const BinaryOperator::Opcode Op, const Expr *CondLhs,
const Expr *CondRhs, const Expr *AssignLhs,
const Expr *AssignRhs, const ASTContext &Context) { … }
static bool maxCondition(const BinaryOperator::Opcode Op, const Expr *CondLhs,
const Expr *CondRhs, const Expr *AssignLhs,
const Expr *AssignRhs, const ASTContext &Context) { … }
QualType getNonTemplateAlias(QualType QT) { … }
static std::string createReplacement(const Expr *CondLhs, const Expr *CondRhs,
const Expr *AssignLhs,
const SourceManager &Source,
const LangOptions &LO,
StringRef FunctionName,
const BinaryOperator *BO) { … }
UseStdMinMaxCheck::UseStdMinMaxCheck(StringRef Name, ClangTidyContext *Context)
: … { … }
void UseStdMinMaxCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { … }
void UseStdMinMaxCheck::registerMatchers(MatchFinder *Finder) { … }
void UseStdMinMaxCheck::registerPPCallbacks(const SourceManager &SM,
Preprocessor *PP,
Preprocessor *ModuleExpanderPP) { … }
void UseStdMinMaxCheck::check(const MatchFinder::MatchResult &Result) { … }
}