1279d72d3SHaojian Wu //===--- FasterStrsplitDelimiterCheck.h - clang-tidy-------------*- C++ -*-===// 2279d72d3SHaojian Wu // 32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6279d72d3SHaojian Wu // 7279d72d3SHaojian Wu //===----------------------------------------------------------------------===// 8279d72d3SHaojian Wu 9279d72d3SHaojian Wu #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_FASTERSTRSPLITDELIMITERCHECK_H 10279d72d3SHaojian Wu #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_FASTERSTRSPLITDELIMITERCHECK_H 11279d72d3SHaojian Wu 12860aefd0SNathan James #include "../ClangTidyCheck.h" 13279d72d3SHaojian Wu 14*4718da50SCarlos Galvez namespace clang::tidy::abseil { 15279d72d3SHaojian Wu 16279d72d3SHaojian Wu /// Finds instances of absl::StrSplit() or absl::MaxSplits() where the delimiter 17279d72d3SHaojian Wu /// is a single character string literal and replaces it with a character. 18279d72d3SHaojian Wu /// 19279d72d3SHaojian Wu /// For the user-facing documentation see: 206e566bc5SRichard /// http://clang.llvm.org/extra/clang-tidy/checks/abseil/faster-strsplit-delimiter.html 21279d72d3SHaojian Wu class FasterStrsplitDelimiterCheck : public ClangTidyCheck { 22279d72d3SHaojian Wu public: FasterStrsplitDelimiterCheck(StringRef Name,ClangTidyContext * Context)23279d72d3SHaojian Wu FasterStrsplitDelimiterCheck(StringRef Name, ClangTidyContext *Context) 24279d72d3SHaojian Wu : ClangTidyCheck(Name, Context) {} isLanguageVersionSupported(const LangOptions & LangOpts)25e40a742aSNathan James bool isLanguageVersionSupported(const LangOptions &LangOpts) const override { 26e40a742aSNathan James return LangOpts.CPlusPlus; 27e40a742aSNathan James } 28279d72d3SHaojian Wu void registerMatchers(ast_matchers::MatchFinder *Finder) override; 29279d72d3SHaojian Wu void check(const ast_matchers::MatchFinder::MatchResult &Result) override; 30279d72d3SHaojian Wu }; 31279d72d3SHaojian Wu 32*4718da50SCarlos Galvez } // namespace clang::tidy::abseil 33279d72d3SHaojian Wu 34279d72d3SHaojian Wu #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_FASTERSTRSPLITDELIMITERCHECK_H 35