#include "UnusedParametersCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTLambda.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/STLExtras.h"
#include <unordered_map>
#include <unordered_set>
usingnamespaceclang::ast_matchers;
namespace clang::tidy::misc {
namespace {
bool isOverrideMethod(const FunctionDecl *Function) { … }
}
void UnusedParametersCheck::registerMatchers(MatchFinder *Finder) { … }
template <typename T>
static CharSourceRange removeNode(const MatchFinder::MatchResult &Result,
const T *PrevNode, const T *Node,
const T *NextNode) { … }
static FixItHint removeParameter(const MatchFinder::MatchResult &Result,
const FunctionDecl *Function, unsigned Index) { … }
static FixItHint removeArgument(const MatchFinder::MatchResult &Result,
const CallExpr *Call, unsigned Index) { … }
class UnusedParametersCheck::IndexerVisitor
: public RecursiveASTVisitor<IndexerVisitor> { … };
UnusedParametersCheck::~UnusedParametersCheck() = default;
UnusedParametersCheck::UnusedParametersCheck(StringRef Name,
ClangTidyContext *Context)
: … { … }
void UnusedParametersCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { … }
void UnusedParametersCheck::warnOnUnusedParameter(
const MatchFinder::MatchResult &Result, const FunctionDecl *Function,
unsigned ParamIndex) { … }
void UnusedParametersCheck::check(const MatchFinder::MatchResult &Result) { … }
}