xref: /llvm-project/clang-tools-extra/clang-tidy/readability/RedundantPreprocessorCheck.h (revision 4718da506091a37ca4863d979bc541e359b79b10)
198ef5337SMiklos Vajna //===--- RedundantPreprocessorCheck.h - clang-tidy --------------*- C++ -*-===//
298ef5337SMiklos Vajna //
32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
698ef5337SMiklos Vajna //
798ef5337SMiklos Vajna //===----------------------------------------------------------------------===//
898ef5337SMiklos Vajna 
998ef5337SMiklos Vajna #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTPREPROCESSORCHECK_H
1098ef5337SMiklos Vajna #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTPREPROCESSORCHECK_H
1198ef5337SMiklos Vajna 
12478fc5c8SAlexander Kornienko #include "../ClangTidyCheck.h"
1398ef5337SMiklos Vajna 
14*4718da50SCarlos Galvez namespace clang::tidy::readability {
1598ef5337SMiklos Vajna 
1698ef5337SMiklos Vajna /// This check flags redundant preprocessor directives: nested directives with
1798ef5337SMiklos Vajna /// the same condition.
1898ef5337SMiklos Vajna ///
1998ef5337SMiklos Vajna /// For the user-facing documentation see:
206e566bc5SRichard /// http://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-preprocessor.html
2198ef5337SMiklos Vajna class RedundantPreprocessorCheck : public ClangTidyCheck {
2298ef5337SMiklos Vajna public:
RedundantPreprocessorCheck(StringRef Name,ClangTidyContext * Context)2398ef5337SMiklos Vajna   RedundantPreprocessorCheck(StringRef Name, ClangTidyContext *Context)
2498ef5337SMiklos Vajna       : ClangTidyCheck(Name, Context) {}
25b6c4db99SAlexander Kornienko   void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
26b6c4db99SAlexander Kornienko                            Preprocessor *ModuleExpanderPP) override;
2798ef5337SMiklos Vajna };
2898ef5337SMiklos Vajna 
29*4718da50SCarlos Galvez } // namespace clang::tidy::readability
3098ef5337SMiklos Vajna 
3198ef5337SMiklos Vajna #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTPREPROCESSORCHECK_H
32