clang-tools 22.0.0git
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
13
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
22public:
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
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
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.
Base class for handling converting std iterator algorithms to a range equivalent.
llvm::StringMap< llvm::IntrusiveRefCntPtr< Replacer > > ReplacerMap