clang-tools 22.0.0git
|
Finds possible inefficient std::vector operations (e.g. More...
#include <InefficientVectorOperationCheck.h>
Public Member Functions | |
InefficientVectorOperationCheck (StringRef Name, ClangTidyContext *Context) | |
bool | isLanguageVersionSupported (const LangOptions &LangOpts) const override |
void | registerMatchers (ast_matchers::MatchFinder *Finder) override |
void | check (const ast_matchers::MatchFinder::MatchResult &Result) override |
void | storeOptions (ClangTidyOptions::OptionMap &Opts) override |
Finds possible inefficient std::vector operations (e.g.
push_back) in for loops that may cause unnecessary memory reallocations.
When EnableProto, also finds calls that add element to protobuf repeated field without calling Reserve() first.
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/performance/inefficient-vector-operation.html
Definition at line 24 of file InefficientVectorOperationCheck.h.
clang::tidy::performance::InefficientVectorOperationCheck::InefficientVectorOperationCheck | ( | StringRef | Name, |
ClangTidyContext * | Context ) |
Definition at line 75 of file InefficientVectorOperationCheck.cpp.
|
override |
Definition at line 179 of file InefficientVectorOperationCheck.cpp.
References clang::tidy::utils::decl_ref_expr::allDeclRefExprs().
|
inlineoverride |
Definition at line 27 of file InefficientVectorOperationCheck.h.
|
override |
Definition at line 158 of file InefficientVectorOperationCheck.cpp.
|
override |
Definition at line 82 of file InefficientVectorOperationCheck.cpp.
References clang::tidy::utils::options::serializeStringList().