clang-tools
22.0.0git
llvm-project
clang-tools-extra
clang-tidy
llvm
llvm/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_LLVM_USERANGESCHECK_H
10
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_USERANGESCHECK_H
11
12
#include "
../utils/UseRangesCheck.h
"
13
14
namespace
clang::tidy::llvm_check
{
15
16
/// Finds calls to STL iterator algorithms that can be replaced with LLVM
17
/// range-based algorithms from `llvm/ADT/STLExtras.h`.
18
///
19
/// For the user-facing documentation see:
20
/// http://clang.llvm.org/extra/clang-tidy/checks/llvm/use-ranges.html
21
class
UseRangesCheck
:
public
utils::UseRangesCheck
{
22
public
:
23
UseRangesCheck
(StringRef Name,
ClangTidyContext
*Context);
24
25
ReplacerMap
getReplacerMap
()
const override
;
26
DiagnosticBuilder
createDiag
(
const
CallExpr &Call)
override
;
27
ArrayRef<std::pair<StringRef, StringRef>>
28
getFreeBeginEndMethods
()
const override
;
29
};
30
31
}
// namespace clang::tidy::llvm_check
32
33
#endif
// LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_USERANGESCHECK_H
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition
ClangTidyDiagnosticConsumer.h:69
clang::tidy::llvm_check::UseRangesCheck::UseRangesCheck
UseRangesCheck(StringRef Name, ClangTidyContext *Context)
Definition
llvm/UseRangesCheck.cpp:79
clang::tidy::llvm_check::UseRangesCheck::getReplacerMap
ReplacerMap getReplacerMap() const override
Gets a map of function to replace and methods to create the replacements.
Definition
llvm/UseRangesCheck.cpp:42
clang::tidy::llvm_check::UseRangesCheck::createDiag
DiagnosticBuilder createDiag(const CallExpr &Call) override
Create a diagnostic for the CallExpr Override this to support custom diagnostic messages.
Definition
llvm/UseRangesCheck.cpp:82
clang::tidy::llvm_check::UseRangesCheck::getFreeBeginEndMethods
ArrayRef< std::pair< StringRef, StringRef > > getFreeBeginEndMethods() const override
Gets the fully qualified names of begin and end functions.
Definition
llvm/UseRangesCheck.cpp:87
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::llvm_check
Definition
HeaderGuardCheck.cpp:13
UseRangesCheck.h
Generated on
for clang-tools by
1.14.0