1 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" 2 #include "clang/StaticAnalyzer/Core/Checker.h" 3 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" 4 #include "clang/StaticAnalyzer/Frontend/CheckerRegistry.h" 5 6 using namespace clang; 7 using namespace ento; 8 9 namespace { 10 struct Dependency : public Checker<check::BeginFunction> { 11 void checkBeginFunction(CheckerContext &Ctx) const {} 12 }; 13 struct DependendentChecker : public Checker<check::BeginFunction> { 14 void checkBeginFunction(CheckerContext &Ctx) const {} 15 }; 16 } // end anonymous namespace 17 18 // Register plugin! 19 extern "C" void clang_registerCheckers(CheckerRegistry ®istry) { 20 registry.addChecker<Dependency>("example.Dependency", "", ""); 21 registry.addChecker<DependendentChecker>("example.DependendentChecker", "", 22 ""); 23 24 registry.addDependency("example.DependendentChecker", "example.Dependency"); 25 } 26 27 extern "C" const char clang_analyzerAPIVersionString[] = 28 CLANG_ANALYZER_API_VERSION_STRING; 29