1 //===--- ObjCTidyModule.cpp - clang-tidy --------------------------------===// 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 #include "../ClangTidy.h" 11 #include "../ClangTidyModule.h" 12 #include "../ClangTidyModuleRegistry.h" 13 #include "ForbiddenSubclassingCheck.h" 14 15 using namespace clang::ast_matchers; 16 17 namespace clang { 18 namespace tidy { 19 namespace objc { 20 21 class ObjCModule : public ClangTidyModule { 22 public: 23 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { 24 CheckFactories.registerCheck<ForbiddenSubclassingCheck>( 25 "objc-forbidden-subclassing"); 26 } 27 }; 28 29 // Register the ObjCTidyModule using this statically initialized variable. 30 static ClangTidyModuleRegistry::Add<ObjCModule> X( 31 "objc-module", 32 "Adds Objective-C lint checks."); 33 34 } // namespace objc 35 36 // This anchor is used to force the linker to link in the generated object file 37 // and thus register the ObjCModule. 38 volatile int ObjCModuleAnchorSource = 0; 39 40 } // namespace tidy 41 } // namespace clang 42