clang-tools 22.0.0git
clang::tidy::readability::UseStdMinMaxCheck Class Reference

Replaces certain conditional statements with equivalent calls to std::min or std::max. More...

#include <UseStdMinMaxCheck.h>

Inheritance diagram for clang::tidy::readability::UseStdMinMaxCheck:
[legend]

Public Member Functions

 UseStdMinMaxCheck (StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override
void registerPPCallbacks (const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override
void storeOptions (ClangTidyOptions::OptionMap &Opts) override
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override
std::optional< TraversalKind > getCheckTraversalKind () const override

Detailed Description

Replaces certain conditional statements with equivalent calls to std::min or std::max.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/readability/UseStdMinMax.html

Definition at line 21 of file UseStdMinMaxCheck.h.

Constructor & Destructor Documentation

◆ UseStdMinMaxCheck()

clang::tidy::readability::UseStdMinMaxCheck::UseStdMinMaxCheck ( StringRef Name,
ClangTidyContext * Context )

Definition at line 123 of file UseStdMinMaxCheck.cpp.

Member Function Documentation

◆ check()

void clang::tidy::readability::UseStdMinMaxCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

◆ getCheckTraversalKind()

std::optional< TraversalKind > clang::tidy::readability::UseStdMinMaxCheck::getCheckTraversalKind ( ) const
inlineoverride

Definition at line 32 of file UseStdMinMaxCheck.h.

◆ isLanguageVersionSupported()

bool clang::tidy::readability::UseStdMinMaxCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 24 of file UseStdMinMaxCheck.h.

◆ registerMatchers()

void clang::tidy::readability::UseStdMinMaxCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 133 of file UseStdMinMaxCheck.cpp.

◆ registerPPCallbacks()

void clang::tidy::readability::UseStdMinMaxCheck::registerPPCallbacks ( const SourceManager & SM,
Preprocessor * PP,
Preprocessor * ModuleExpanderPP )
override

Definition at line 155 of file UseStdMinMaxCheck.cpp.

◆ storeOptions()

void clang::tidy::readability::UseStdMinMaxCheck::storeOptions ( ClangTidyOptions::OptionMap & Opts)
override

Definition at line 129 of file UseStdMinMaxCheck.cpp.


The documentation for this class was generated from the following files: