clang-tools 22.0.0git
clang::tidy::llvm_check::UseRangesCheck Class Reference

Finds calls to STL iterator algorithms that can be replaced with LLVM range-based algorithms from llvm/ADT/STLExtras.h. More...

#include <UseRangesCheck.h>

Inheritance diagram for clang::tidy::llvm_check::UseRangesCheck:
[legend]

Public Member Functions

 UseRangesCheck (StringRef Name, ClangTidyContext *Context)
ReplacerMap getReplacerMap () const override
 Gets a map of function to replace and methods to create the replacements.
DiagnosticBuilder createDiag (const CallExpr &Call) override
 Create a diagnostic for the CallExpr Override this to support custom diagnostic messages.
ArrayRef< std::pair< StringRef, StringRef > > getFreeBeginEndMethods () const override
 Gets the fully qualified names of begin and end functions.
Public Member Functions inherited from clang::tidy::utils::UseRangesCheck
 UseRangesCheck (StringRef Name, ClangTidyContext *Context)
virtual std::optional< ReverseIteratorDescriptorgetReverseDescriptor () const
void registerPPCallbacks (const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) final
void registerMatchers (ast_matchers::MatchFinder *Finder) final
void check (const ast_matchers::MatchFinder::MatchResult &Result) final
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override
void storeOptions (ClangTidyOptions::OptionMap &Opts) override
std::optional< TraversalKind > getCheckTraversalKind () const override

Additional Inherited Members

Public Types inherited from clang::tidy::utils::UseRangesCheck
using Signature = SmallVector<Indexes, 2>
using ReplacerMap = llvm::StringMap<llvm::IntrusiveRefCntPtr<Replacer>>

Detailed Description

Finds calls to STL iterator algorithms that can be replaced with LLVM range-based algorithms from llvm/ADT/STLExtras.h.

For the user-facing documentation see: http://clang.llvm.org/extra/clang-tidy/checks/llvm/use-ranges.html

Definition at line 21 of file llvm/UseRangesCheck.h.

Constructor & Destructor Documentation

◆ UseRangesCheck()

clang::tidy::llvm_check::UseRangesCheck::UseRangesCheck ( StringRef Name,
ClangTidyContext * Context )

Definition at line 79 of file llvm/UseRangesCheck.cpp.

References UseRangesCheck().

Referenced by UseRangesCheck().

Member Function Documentation

◆ createDiag()

DiagnosticBuilder clang::tidy::llvm_check::UseRangesCheck::createDiag ( const CallExpr & Call)
overridevirtual

Create a diagnostic for the CallExpr Override this to support custom diagnostic messages.

Reimplemented from clang::tidy::utils::UseRangesCheck.

Definition at line 82 of file llvm/UseRangesCheck.cpp.

◆ getFreeBeginEndMethods()

ArrayRef< std::pair< StringRef, StringRef > > clang::tidy::llvm_check::UseRangesCheck::getFreeBeginEndMethods ( ) const
overridevirtual

Gets the fully qualified names of begin and end functions.

The functions must take the container as their one and only argument ::std::begin and ::std::end are a common example

Reimplemented from clang::tidy::utils::UseRangesCheck.

Definition at line 87 of file llvm/UseRangesCheck.cpp.

◆ getReplacerMap()

utils::UseRangesCheck::ReplacerMap clang::tidy::llvm_check::UseRangesCheck::getReplacerMap ( ) const
overridevirtual

Gets a map of function to replace and methods to create the replacements.

Implements clang::tidy::utils::UseRangesCheck.

Definition at line 42 of file llvm/UseRangesCheck.cpp.


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