#include "InefficientVectorOperationCheck.h"
#include "../utils/DeclRefExprUtils.h"
#include "../utils/OptionsUtils.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Lex/Lexer.h"
usingnamespaceclang::ast_matchers;
namespace clang::tidy::performance {
namespace {
static const char LoopCounterName[] = …;
static const char LoopParentName[] = …;
static const char VectorVarDeclName[] = …;
static const char VectorVarDeclStmtName[] = …;
static const char PushBackOrEmplaceBackCallName[] = …;
static const char ProtoVarDeclName[] = …;
static const char ProtoVarDeclStmtName[] = …;
static const char ProtoAddFieldCallName[] = …;
static const char LoopInitVarName[] = …;
static const char LoopEndExprName[] = …;
static const char RangeLoopName[] = …;
ast_matchers::internal::Matcher<Expr> supportedContainerTypesMatcher() { … }
AST_MATCHER(Expr, hasSideEffects) { … }
}
InefficientVectorOperationCheck::InefficientVectorOperationCheck(
StringRef Name, ClangTidyContext *Context)
: … { … }
void InefficientVectorOperationCheck::storeOptions(
ClangTidyOptions::OptionMap &Opts) { … }
void InefficientVectorOperationCheck::addMatcher(
const DeclarationMatcher &TargetRecordDecl, StringRef VarDeclName,
StringRef VarDeclStmtName, const DeclarationMatcher &AppendMethodDecl,
StringRef AppendCallName, MatchFinder *Finder) { … }
void InefficientVectorOperationCheck::registerMatchers(MatchFinder *Finder) { … }
void InefficientVectorOperationCheck::check(
const MatchFinder::MatchResult &Result) { … }
}