clang-tools 6.0.0

ForbiddenSubclassingCheck.h
Go to the documentation of this file.
1 //===--- ForbiddenSubclassingCheck.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_OBJC_FORBIDDEN_SUBCLASSING_CHECK_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_FORBIDDEN_SUBCLASSING_CHECK_H
12
13 #include "../ClangTidy.h"
14 #include "llvm/ADT/StringRef.h"
15 #include <string>
16 #include <vector>
17
18 namespace clang {
19 namespace tidy {
20 namespace objc {
21
22 /// Finds Objective-C classes which have a superclass which is
23 /// documented to not support subclassing.
24 ///
25 /// For the user-facing documentation see:
26 /// http://clang.llvm.org/extra/clang-tidy/checks/objc-forbidden-subclassing.html
27 class ForbiddenSubclassingCheck : public ClangTidyCheck {
28 public:
29 ForbiddenSubclassingCheck(StringRef Name, ClangTidyContext *Context);
30 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
31 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
32 void storeOptions(ClangTidyOptions::OptionMap &Options) override;
33
34 private:
35 const std::vector<std::string> ForbiddenSuperClassNames;
36 };
37
38 } // namespace objc
39 } // namespace tidy
40 } // namespace clang
41
42 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_FORBIDDEN_SUBCLASSING_CHECK_H
Name
StringHandle Name
Definition: PreprocessorTracker.cpp:525
clang::tidy::objc::ForbiddenSubclassingCheck
Finds Objective-C classes which have a superclass which is documented to not support subclassing...
Definition: ForbiddenSubclassingCheck.h:27
clang::tidy::objc::ForbiddenSubclassingCheck::registerMatchers
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
Definition: ForbiddenSubclassingCheck.cpp:79
clang::tidy::ClangTidyCheck
Base class for all clang-tidy checks.
Definition: ClangTidy.h:127
clang::tidy::objc::ForbiddenSubclassingCheck::storeOptions
void storeOptions(ClangTidyOptions::OptionMap &Options) override
Should store all options supported by this check with their current values or default values for opti...
Definition: ForbiddenSubclassingCheck.cpp:108
clang::tidy::ClangTidyCheck::Options
OptionsView Options
Definition: ClangTidy.h:183
clang::tidy::ClangTidyOptions::OptionMap
std::map< std::string, std::string > OptionMap
Definition: ClangTidyOptions.h:99
clang
Definition: AndroidTidyModule.cpp:28
clang::tidy::objc::ForbiddenSubclassingCheck::check
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Definition: ForbiddenSubclassingCheck.cpp:93
clang::tidy::objc::ForbiddenSubclassingCheck::ForbiddenSubclassingCheck
ForbiddenSubclassingCheck(StringRef Name, ClangTidyContext *Context)
Definition: ForbiddenSubclassingCheck.cpp:70
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition: ClangTidyDiagnosticConsumer.h:104