#include "UnnecessaryValueParamCheck.h"
#include "../utils/DeclRefExprUtils.h"
#include "../utils/FixItHintUtils.h"
#include "../utils/Matchers.h"
#include "../utils/OptionsUtils.h"
#include "../utils/TypeTraits.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Lex/Lexer.h"
#include "clang/Lex/Preprocessor.h"
#include <optional>
usingnamespaceclang::ast_matchers;
namespace clang::tidy::performance {
namespace {
std::string paramNameOrIndex(StringRef Name, size_t Index) { … }
bool isReferencedOutsideOfCallExpr(const FunctionDecl &Function,
ASTContext &Context) { … }
bool hasLoopStmtAncestor(const DeclRefExpr &DeclRef, const Decl &Decl,
ASTContext &Context) { … }
}
UnnecessaryValueParamCheck::UnnecessaryValueParamCheck(
StringRef Name, ClangTidyContext *Context)
: … { … }
void UnnecessaryValueParamCheck::registerMatchers(MatchFinder *Finder) { … }
void UnnecessaryValueParamCheck::check(const MatchFinder::MatchResult &Result) { … }
void UnnecessaryValueParamCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) { … }
void UnnecessaryValueParamCheck::storeOptions(
ClangTidyOptions::OptionMap &Opts) { … }
void UnnecessaryValueParamCheck::onEndOfTranslationUnit() { … }
void UnnecessaryValueParamCheck::handleConstRefFix(const FunctionDecl &Function,
const ParmVarDecl &Param,
ASTContext &Context) { … }
void UnnecessaryValueParamCheck::handleMoveFix(const ParmVarDecl &Param,
const DeclRefExpr &CopyArgument,
ASTContext &Context) { … }
}