clang-tools 23.0.0git
UseStdMoveCheck.h
Go to the documentation of this file.
1//===--- InefficientCopyAssign.h - clang-tidy -----------------------------===//
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_PERFORMANCE_USESTDMOVECHECK_H
10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_USESTDMOVECHECK_H
11
12#include "../ClangTidyCheck.h"
13
14#include "clang/Analysis/CFG.h"
15
17
19public:
20 UseStdMoveCheck(StringRef Name, ClangTidyContext *Context)
21 : ClangTidyCheck(Name, Context) {}
22 bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
23 return LangOpts.CPlusPlus11;
24 }
25 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
26 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
27
28private:
29 llvm::DenseMap<const FunctionDecl *, std::unique_ptr<CFG>> CFGCache;
30 const CFG *getCFG(const FunctionDecl *, ASTContext *);
31};
32
33} // namespace clang::tidy::performance
34
35#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_USESTDMOVECHECK_H
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override
UseStdMoveCheck(StringRef Name, ClangTidyContext *Context)
void registerMatchers(ast_matchers::MatchFinder *Finder) override
void check(const ast_matchers::MatchFinder::MatchResult &Result) override