|
clang-tools 23.0.0git
|
Looks for functions returning std::[w|u8|u16|u32]string and suggests to change it to std::[...]string_view if possible and profitable. More...
#include <UseStringViewCheck.h>
Public Member Functions | |
| UseStringViewCheck (StringRef Name, ClangTidyContext *Context) | |
| void | storeOptions (ClangTidyOptions::OptionMap &Opts) override |
| void | registerMatchers (ast_matchers::MatchFinder *Finder) override |
| void | check (const ast_matchers::MatchFinder::MatchResult &Result) override |
| bool | isLanguageVersionSupported (const LangOptions &LangOpts) const override |
| std::optional< TraversalKind > | getCheckTraversalKind () const override |
Looks for functions returning std::[w|u8|u16|u32]string and suggests to change it to std::[...]string_view if possible and profitable.
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-string-view.html
Definition at line 21 of file UseStringViewCheck.h.
| clang::tidy::modernize::UseStringViewCheck::UseStringViewCheck | ( | StringRef | Name, |
| ClangTidyContext * | Context ) |
Definition at line 48 of file UseStringViewCheck.cpp.
|
override |
Definition at line 98 of file UseStringViewCheck.cpp.
References clang::tidy::modernize::fixReturns(), and FuncDecl.
|
inlineoverride |
Definition at line 30 of file UseStringViewCheck.h.
|
inlineoverride |
Definition at line 27 of file UseStringViewCheck.h.
|
override |
Definition at line 69 of file UseStringViewCheck.cpp.
References clang::tidy::modernize::getStringTypeMatcher(), and clang::tidy::matchers::matchesAnyListedRegexName().
|
override |
Definition at line 57 of file UseStringViewCheck.cpp.
References clang::tidy::utils::options::serializeStringList(), clang::tidy::modernize::StringViewClassKey, clang::tidy::modernize::U16StringViewClassKey, clang::tidy::modernize::U32StringViewClassKey, clang::tidy::modernize::U8StringViewClassKey, and clang::tidy::modernize::WStringViewClassKey.