clang-tools  4.0.0
UnusedAliasDeclsCheck.h
Go to the documentation of this file.
1 //===--- UnusedAliasDeclsCheck.h - clang-tidy--------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_ALIAS_DECLS_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_ALIAS_DECLS_H
12 
13 #include "../ClangTidy.h"
14 #include "llvm/ADT/DenseMap.h"
15 
16 namespace clang {
17 namespace tidy {
18 namespace misc {
19 
20 /// Finds unused namespace alias declarations.
22 public:
24  : ClangTidyCheck(Name, Context) {}
25  void registerMatchers(ast_matchers::MatchFinder *Finder) override;
26  void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
27  void onEndOfTranslationUnit() override;
28 
29 private:
30  llvm::DenseMap<const NamedDecl *, CharSourceRange> FoundDecls;
31 };
32 
33 } // namespace misc
34 } // namespace tidy
35 } // namespace clang
36 
37 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_ALIAS_DECLS_H
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
UnusedAliasDeclsCheck(StringRef Name, ClangTidyContext *Context)
const std::string Name
Definition: USRFinder.cpp:164
std::unique_ptr< ast_matchers::MatchFinder > Finder
Definition: ClangTidy.cpp:262
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Finds unused namespace alias declarations.
Base class for all clang-tidy checks.
Definition: ClangTidy.h:127
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
const NamedDecl * Result
Definition: USRFinder.cpp:162