forked from OSchip/llvm-project
[clang-tidy] Update lang restrictions on perf module
This commit is contained in:
parent
614b995cac
commit
bfd99be0fc
|
@ -59,9 +59,6 @@ void FasterStringFindCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
|
|||
}
|
||||
|
||||
void FasterStringFindCheck::registerMatchers(MatchFinder *Finder) {
|
||||
if (!getLangOpts().CPlusPlus)
|
||||
return;
|
||||
|
||||
const auto SingleChar =
|
||||
expr(ignoringParenCasts(stringLiteral(hasSize(1)).bind("literal")));
|
||||
const auto StringFindFunctions =
|
||||
|
|
|
@ -27,6 +27,9 @@ namespace performance {
|
|||
class FasterStringFindCheck : public ClangTidyCheck {
|
||||
public:
|
||||
FasterStringFindCheck(StringRef Name, ClangTidyContext *Context);
|
||||
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override{
|
||||
return LangOpts.CPlusPlus;
|
||||
}
|
||||
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
|
||||
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
|
||||
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
|
||||
|
|
|
@ -22,6 +22,9 @@ namespace performance {
|
|||
class ForRangeCopyCheck : public ClangTidyCheck {
|
||||
public:
|
||||
ForRangeCopyCheck(StringRef Name, ClangTidyContext *Context);
|
||||
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override{
|
||||
return LangOpts.CPlusPlus11;
|
||||
}
|
||||
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
|
||||
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
|
||||
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
|
||||
|
|
|
@ -22,6 +22,9 @@ class ImplicitConversionInLoopCheck : public ClangTidyCheck {
|
|||
public:
|
||||
ImplicitConversionInLoopCheck(StringRef Name, ClangTidyContext *Context)
|
||||
: ClangTidyCheck(Name, Context) {}
|
||||
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override{
|
||||
return LangOpts.CPlusPlus11;
|
||||
}
|
||||
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
|
||||
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
|
||||
|
||||
|
|
|
@ -26,6 +26,9 @@ namespace performance {
|
|||
class InefficientVectorOperationCheck : public ClangTidyCheck {
|
||||
public:
|
||||
InefficientVectorOperationCheck(StringRef Name, ClangTidyContext *Context);
|
||||
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override{
|
||||
return LangOpts.CPlusPlus;
|
||||
}
|
||||
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
|
||||
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
|
||||
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
|
||||
|
|
|
@ -26,6 +26,9 @@ namespace performance {
|
|||
class UnnecessaryCopyInitialization : public ClangTidyCheck {
|
||||
public:
|
||||
UnnecessaryCopyInitialization(StringRef Name, ClangTidyContext *Context);
|
||||
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override{
|
||||
return LangOpts.CPlusPlus;
|
||||
}
|
||||
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
|
||||
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
|
||||
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
|
||||
|
|
Loading…
Reference in New Issue