Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:20

0001 //===--- UnusedParametersCheck.h - clang-tidy--------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_PARAMETERS_H
0010 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_PARAMETERS_H
0011 
0012 #include "../ClangTidyCheck.h"
0013 
0014 namespace clang::tidy::misc {
0015 
0016 /// Finds unused parameters and fixes them, so that `-Wunused-parameter` can be
0017 /// turned on.
0018 class UnusedParametersCheck : public ClangTidyCheck {
0019 public:
0020   UnusedParametersCheck(StringRef Name, ClangTidyContext *Context);
0021   ~UnusedParametersCheck();
0022   void registerMatchers(ast_matchers::MatchFinder *Finder) override;
0023   void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
0024   void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
0025 
0026 private:
0027   const bool StrictMode;
0028   const bool IgnoreVirtual;
0029   class IndexerVisitor;
0030   std::unique_ptr<IndexerVisitor> Indexer;
0031 
0032   void
0033   warnOnUnusedParameter(const ast_matchers::MatchFinder::MatchResult &Result,
0034                         const FunctionDecl *Function, unsigned ParamIndex);
0035 };
0036 
0037 } // namespace clang::tidy::misc
0038 
0039 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_PARAMETERS_H