#include "ForRangeCopyCheck.h"
#include "../utils/DeclRefExprUtils.h"
#include "../utils/FixItHintUtils.h"
#include "../utils/Matchers.h"
#include "../utils/OptionsUtils.h"
#include "../utils/TypeTraits.h"
#include "clang/Analysis/Analyses/ExprMutationAnalyzer.h"
#include "clang/Basic/Diagnostic.h"
#include <optional>
usingnamespaceclang::ast_matchers;
namespace clang::tidy::performance {
ForRangeCopyCheck::ForRangeCopyCheck(StringRef Name, ClangTidyContext *Context)
: … { … }
void ForRangeCopyCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { … }
void ForRangeCopyCheck::registerMatchers(MatchFinder *Finder) { … }
void ForRangeCopyCheck::check(const MatchFinder::MatchResult &Result) { … }
bool ForRangeCopyCheck::handleConstValueCopy(const VarDecl &LoopVar,
ASTContext &Context) { … }
static bool isReferenced(const VarDecl &LoopVar, const Stmt &Stmt,
ASTContext &Context) { … }
bool ForRangeCopyCheck::handleCopyIsOnlyConstReferenced(
const VarDecl &LoopVar, const CXXForRangeStmt &ForRange,
ASTContext &Context) { … }
}