clang-tools
20.0.0git
llvm-project
clang-tools-extra
clang-tidy
modernize
modernize/UseRangesCheck.h
Go to the documentation of this file.
1
//===--- UseRangesCheck.h - clang-tidy --------------------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USERANGESCHECK_H
10
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USERANGESCHECK_H
11
12
#include "../utils/UseRangesCheck.h"
13
14
namespace
clang::tidy::modernize
{
15
16
/// Detects calls to standard library iterator algorithms that could be
17
/// replaced with a ranges version instead
18
///
19
/// For the user-facing documentation see:
20
/// http://clang.llvm.org/extra/clang-tidy/checks/modernize/use-ranges.html
21
class
UseRangesCheck
:
public
utils::UseRangesCheck
{
22
public
:
23
UseRangesCheck
(StringRef CheckName,
ClangTidyContext
*Context);
24
25
void
storeOptions
(
ClangTidyOptions::OptionMap
&
Options
)
override
;
26
27
ReplacerMap
getReplacerMap
()
const override
;
28
29
ArrayRef<std::pair<StringRef, StringRef>>
30
getFreeBeginEndMethods
()
const override
;
31
32
std::optional<ReverseIteratorDescriptor>
33
getReverseDescriptor
()
const override
;
34
35
bool
isLanguageVersionSupported
(
const
LangOptions &LangOpts)
const override
;
36
37
private
:
38
bool
UseReversePipe;
39
};
40
41
}
// namespace clang::tidy::modernize
42
43
#endif
// LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USERANGESCHECK_H
clang::tidy::ClangTidyCheck::Options
OptionsView Options
Definition:
ClangTidyCheck.h:490
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition:
ClangTidyDiagnosticConsumer.h:69
clang::tidy::modernize::UseRangesCheck
Detects calls to standard library iterator algorithms that could be replaced with a ranges version in...
Definition:
modernize/UseRangesCheck.h:21
clang::tidy::modernize::UseRangesCheck::isLanguageVersionSupported
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override
Override this to disable registering matchers and PP callbacks if an invalid language version is bein...
Definition:
modernize/UseRangesCheck.cpp:187
clang::tidy::modernize::UseRangesCheck::getFreeBeginEndMethods
ArrayRef< std::pair< StringRef, StringRef > > getFreeBeginEndMethods() const override
Gets the fully qualified names of begin and end functions.
Definition:
modernize/UseRangesCheck.cpp:192
clang::tidy::modernize::UseRangesCheck::storeOptions
void storeOptions(ClangTidyOptions::OptionMap &Options) override
Should store all options supported by this check with their current values or default values for opti...
Definition:
modernize/UseRangesCheck.cpp:182
clang::tidy::modernize::UseRangesCheck::getReplacerMap
ReplacerMap getReplacerMap() const override
Gets a map of function to replace and methods to create the replacements.
Definition:
modernize/UseRangesCheck.cpp:137
clang::tidy::modernize::UseRangesCheck::getReverseDescriptor
std::optional< ReverseIteratorDescriptor > getReverseDescriptor() const override
Definition:
modernize/UseRangesCheck.cpp:198
clang::tidy::utils::UseRangesCheck
Base class for handling converting std iterator algorithms to a range equivalent.
Definition:
utils/UseRangesCheck.h:26
clang::tidy::utils::UseRangesCheck::ReplacerMap
llvm::StringMap< llvm::IntrusiveRefCntPtr< Replacer > > ReplacerMap
Definition:
utils/UseRangesCheck.h:62
clang::tidy::modernize
Definition:
AvoidBindCheck.cpp:32
clang::tidy::ClangTidyOptions::OptionMap
llvm::StringMap< ClangTidyValue > OptionMap
Definition:
ClangTidyOptions.h:126
Generated on Fri Oct 4 2024 07:42:15 for clang-tools by
1.9.6