clang-tools  8.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
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;
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
Finds Objective-C classes which have a superclass which is documented to not support subclassing...
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
Base class for all clang-tidy checks.
Definition: ClangTidy.h:127
void storeOptions(ClangTidyOptions::OptionMap &Options) override
Should store all options supported by this check with their current values or default values for opti...
static constexpr llvm::StringLiteral Name
std::map< std::string, std::string > OptionMap
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
ForbiddenSubclassingCheck(StringRef Name, ClangTidyContext *Context)
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.