]> granicus.if.org Git - clang/commitdiff
[analyzer] Pass CheckerManager to the registration functions.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 17 Feb 2011 21:39:17 +0000 (21:39 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 17 Feb 2011 21:39:17 +0000 (21:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125777 91177308-0d34-0410-b5e6-96231b3b80d8

20 files changed:
include/clang/StaticAnalyzer/Core/CheckerManager.h
lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
lib/StaticAnalyzer/Checkers/CStringChecker.cpp
lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp
lib/StaticAnalyzer/Checkers/ChrootChecker.cpp
lib/StaticAnalyzer/Checkers/ClangSACheckerProvider.cpp
lib/StaticAnalyzer/Checkers/ClangSACheckers.h
lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp
lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp
lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp
lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp
lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
lib/StaticAnalyzer/Checkers/StackAddrLeakChecker.cpp
lib/StaticAnalyzer/Checkers/StreamChecker.cpp
lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp

index 6a98ed8eebce59008c11ac46554b41d90c195fbc..0cd10de5473478a167a6e7839a8553fd0a530e2c 100644 (file)
@@ -23,16 +23,16 @@ namespace ento {
 
 class CheckerManager {
 public:
-  typedef void (*RegisterFunc)(ExprEngine &Eng);
+  typedef void (*RegisterToEngFunc)(ExprEngine &Eng);
 
-  void addCheckerRegisterFunction(RegisterFunc fn) {
+  void addCheckerRegisterFunction(RegisterToEngFunc fn) {
     Funcs.push_back(fn);
   }
   
   void registerCheckersToEngine(ExprEngine &eng);
 
 private:
-  llvm::SmallVector<RegisterFunc, 8> Funcs;
+  llvm::SmallVector<RegisterToEngFunc, 8> Funcs;
 };
 
 } // end ento namespace
index a1037b9713a861335908a13a74e01fe560b4c3e2..1b6c528c2f167ac0af9dbda584e55219e420dbf7 100644 (file)
@@ -16,6 +16,7 @@
 #include "BasicObjCFoundationChecks.h"
 
 #include "ClangSACheckers.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
@@ -487,18 +488,34 @@ void ClassReleaseChecker::preVisitObjCMessage(CheckerContext &C,
 // Check registration.
 //===----------------------------------------------------------------------===//
 
-void ento::registerNilArgChecker(ExprEngine& Eng) {
+static void RegisterNilArgChecker(ExprEngine& Eng) {
   Eng.registerCheck(new NilArgChecker());
 }
 
-void ento::registerCFNumberCreateChecker(ExprEngine& Eng) {
+void ento::registerNilArgChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterNilArgChecker);
+}
+
+static void RegisterCFNumberCreateChecker(ExprEngine& Eng) {
   Eng.registerCheck(new CFNumberCreateChecker());
 }
 
-void ento::registerCFRetainReleaseChecker(ExprEngine& Eng) {
+void ento::registerCFNumberCreateChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterCFNumberCreateChecker);
+}
+
+static void RegisterCFRetainReleaseChecker(ExprEngine& Eng) {
   Eng.registerCheck(new CFRetainReleaseChecker());
 }
 
-void ento::registerClassReleaseChecker(ExprEngine& Eng) {
+void ento::registerCFRetainReleaseChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterCFRetainReleaseChecker);
+}
+
+static void RegisterClassReleaseChecker(ExprEngine& Eng) {
   Eng.registerCheck(new ClassReleaseChecker());
 }
+
+void ento::registerClassReleaseChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterClassReleaseChecker);
+}
index 1981b87edcd3dea5c8168e7b8bce79fe699c3183..03f9047e960c6ca47fd62d6ea2a7a3182be21ef9 100644 (file)
@@ -13,6 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "ClangSACheckers.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/GRStateTrait.h"
@@ -109,10 +110,14 @@ namespace ento {
 }
 }
 
-void ento::registerCStringChecker(ExprEngine &Eng) {
+static void RegisterCStringChecker(ExprEngine &Eng) {
   Eng.registerCheck(new CStringChecker());
 }
 
+void ento::registerCStringChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterCStringChecker);
+}
+
 //===----------------------------------------------------------------------===//
 // Individual checks and utility methods.
 //===----------------------------------------------------------------------===//
index ca0a319e5339ccaf7845cc2e0ce872225a9fec96..8ec226abf6a9c07d3ded7040f22913011a73fc02 100644 (file)
@@ -14,6 +14,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "ClangSACheckers.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 
@@ -74,6 +75,10 @@ void CastToStructChecker::PreVisitCastExpr(CheckerContext &C,
   }
 }
 
-void ento::registerCastToStructChecker(ExprEngine &Eng) {
+static void RegisterCastToStructChecker(ExprEngine &Eng) {
   Eng.registerCheck(new CastToStructChecker());
 }
+
+void ento::registerCastToStructChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterCastToStructChecker);
+}
index a184dd462227749b66d0e6823140f530cebfc9ee..36e76d0d3ce23ee7d8f72a730e814955969f4a43 100644 (file)
@@ -12,6 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "ClangSACheckers.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/GRState.h"
@@ -59,10 +60,14 @@ private:
 
 } // end anonymous namespace
 
-void ento::registerChrootChecker(ExprEngine &Eng) {
+static void RegisterChrootChecker(ExprEngine &Eng) {
   Eng.registerCheck(new ChrootChecker());
 }
 
+void ento::registerChrootChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterChrootChecker);
+}
+
 bool ChrootChecker::evalCallExpr(CheckerContext &C, const CallExpr *CE) {
   const GRState *state = C.getState();
   const Expr *Callee = CE->getCallee();
index 17646e07d9944e89ba4ef8427f7d6fa56f3f8589..94f200f3e8929b12f7a00bb7660693f51d330266 100644 (file)
@@ -40,7 +40,7 @@ namespace {
 
 struct StaticCheckerInfoRec {
   const char *FullName;
-  CheckerManager::RegisterFunc RegFunc;
+  void (*RegFunc)(CheckerManager &mgr);
   bool Hidden;
 };
 
@@ -132,6 +132,6 @@ void ClangSACheckerProvider::registerCheckers(CheckerManager &checkerMgr,
     collectCheckers(checkOpts[i], enabledCheckers);
   for (llvm::DenseSet<const StaticCheckerInfoRec *>::iterator
          I = enabledCheckers.begin(), E = enabledCheckers.end(); I != E; ++I) {
-    checkerMgr.addCheckerRegisterFunction((*I)->RegFunc);
+    (*I)->RegFunc(checkerMgr);
   }
 }
index b01b0f4c5442399c9175c178e3a882e5e93aece6..73239f55b4e43ce34cecb590c5310ffcdfea63ea 100644 (file)
 namespace clang {
 
 namespace ento {
-class ExprEngine;
+class CheckerManager;
 
 #define GET_CHECKERS
 #define CHECKER(FULLNAME,CLASS,CXXFILE,HELPTEXT,HIDDEN)    \
-  void register##CLASS(ExprEngine &Eng);
+  void register##CLASS(CheckerManager &mgr);
 #include "Checkers.inc"
 #undef CHECKER
 #undef GET_CHECKERS
index b2ef4ffd43296954baf1b21e4148beb4fb9527ac..fe628a2512b27b991a2c3a5726076a15c0eba37b 100644 (file)
@@ -14,6 +14,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "ClangSACheckers.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 
@@ -67,6 +68,10 @@ void FixedAddressChecker::PreVisitBinaryOperator(CheckerContext &C,
   }
 }
 
-void ento::registerFixedAddressChecker(ExprEngine &Eng) {
+static void RegisterFixedAddressChecker(ExprEngine &Eng) {
   Eng.registerCheck(new FixedAddressChecker());
 }
+
+void ento::registerFixedAddressChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterFixedAddressChecker);
+}
index b8111c44ffe5deea98452bbd95eba63cfe0763c4..f49b125a60a2987425d1959db2a74cacae241073 100644 (file)
@@ -45,6 +45,7 @@
 #include "ClangSACheckers.h"
 #include "clang/Analysis/CFGStmtMap.h"
 #include "clang/Analysis/Analyses/PseudoConstantAnalysis.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h"
@@ -132,10 +133,14 @@ void *IdempotentOperationChecker::getTag() {
   return &x;
 }
 
-void ento::registerIdempotentOperationChecker(ExprEngine &Eng) {
+static void RegisterIdempotentOperationChecker(ExprEngine &Eng) {
   Eng.registerCheck(new IdempotentOperationChecker());
 }
 
+void ento::registerIdempotentOperationChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterIdempotentOperationChecker);
+}
+
 void IdempotentOperationChecker::PreVisitBinaryOperator(
                                                       CheckerContext &C,
                                                       const BinaryOperator *B) {
index 3cefded87742b70f59ed12f4d16c9dc63dd2a7e6..358be124b9e4dd938108a2a316e5fd60797cb359 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "ClangSACheckers.h"
 #include "clang/Basic/TargetInfo.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/GRStateTrait.h"
@@ -45,10 +46,14 @@ public:
 };
 } //end anonymous namespace
 
-void ento::registerMacOSXAPIChecker(ExprEngine &Eng) {
+static void RegisterMacOSXAPIChecker(ExprEngine &Eng) {
   Eng.registerCheck(new MacOSXAPIChecker());
 }
 
+void ento::registerMacOSXAPIChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterMacOSXAPIChecker);
+}
+
 //===----------------------------------------------------------------------===//
 // dispatch_once and dispatch_once_f
 //===----------------------------------------------------------------------===//
index a32fe36e566ba86de8f5d4e2c1d11a8952bf83bd..9fb89d79fc7916c3d5cf9775c509c7278d960f3d 100644 (file)
@@ -16,6 +16,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "ClangSACheckers.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
@@ -45,7 +46,7 @@ public:
 } // end anonymous namespace
 
 
-void ento::registerNSAutoreleasePoolChecker(ExprEngine &Eng) {
+static void RegisterNSAutoreleasePoolChecker(ExprEngine &Eng) {
   ASTContext &Ctx = Eng.getContext();
   if (Ctx.getLangOptions().getGCMode() != LangOptions::NonGC) {    
     Eng.registerCheck(new NSAutoreleasePoolChecker(GetNullarySelector("release",
@@ -53,6 +54,10 @@ void ento::registerNSAutoreleasePoolChecker(ExprEngine &Eng) {
   }
 }
 
+void ento::registerNSAutoreleasePoolChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterNSAutoreleasePoolChecker);
+}
+
 void
 NSAutoreleasePoolChecker::preVisitObjCMessage(CheckerContext &C,
                                               ObjCMessage msg) {
index 8285ef4c3139e6fa2664a8b49d47c0314adfe53d..7d440ab17e9f10e6614260a875c24c5b595f0921 100644 (file)
@@ -13,6 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "ClangSACheckers.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Checkers/DereferenceChecker.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
@@ -33,12 +34,16 @@ public:
 };
 } // end anonymous namespace
 
-void ento::registerObjCAtSyncChecker(ExprEngine &Eng) {
+static void RegisterObjCAtSyncChecker(ExprEngine &Eng) {
   // @synchronized is an Objective-C 2 feature.
   if (Eng.getContext().getLangOptions().ObjC2)
     Eng.registerCheck(new ObjCAtSyncChecker());
 }
 
+void ento::registerObjCAtSyncChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterObjCAtSyncChecker);
+}
+
 void ObjCAtSyncChecker::PreVisitObjCAtSynchronizedStmt(CheckerContext &C,
                                          const ObjCAtSynchronizedStmt *S) {
 
index f3810e04ff1c702c59fb5dca47fb97578f1bfd87..4f247ea14670372b3d0184a070627f3fe0af2eb3 100644 (file)
@@ -47,6 +47,7 @@
 // http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocAllocInit.html
 
 #include "ClangSACheckers.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/GRStateTrait.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
@@ -92,11 +93,15 @@ public:
 };
 } // end anonymous namespace
 
-void ento::registerObjCSelfInitChecker(ExprEngine &Eng) {
+static void RegisterObjCSelfInitChecker(ExprEngine &Eng) {
   if (Eng.getContext().getLangOptions().ObjC1)
     Eng.registerCheck(new ObjCSelfInitChecker());
 }
 
+void ento::registerObjCSelfInitChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterObjCSelfInitChecker);
+}
+
 namespace {
 
 class InitSelfBug : public BugType {
index 71b0988c2c63c886ebe9ef8462285898e2cc74ef..741e48bfcbe02c8d33c7bc6b2712281e2b7fcf70 100644 (file)
@@ -13,6 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "ClangSACheckers.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 
@@ -67,6 +68,10 @@ void PointerArithChecker::PreVisitBinaryOperator(CheckerContext &C,
   }
 }
 
-void ento::registerPointerArithChecker(ExprEngine &Eng) {
+static void RegisterPointerArithChecker(ExprEngine &Eng) {
   Eng.registerCheck(new PointerArithChecker());
 }
+
+void ento::registerPointerArithChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterPointerArithChecker);
+}
index 496cb9d47575c803a5992c0faf5786173f554765..f28fe9a5379e3b51c3f7e8b9dec00d636ecea99a 100644 (file)
@@ -14,6 +14,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "ClangSACheckers.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 
@@ -74,6 +75,10 @@ void PointerSubChecker::PreVisitBinaryOperator(CheckerContext &C,
   }
 }
 
-void ento::registerPointerSubChecker(ExprEngine &Eng) {
+static void RegisterPointerSubChecker(ExprEngine &Eng) {
   Eng.registerCheck(new PointerSubChecker());
 }
+
+void ento::registerPointerSubChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterPointerSubChecker);
+}
index e20230a885b867f45090ad6722258efd60af4f40..34c095f42e08469abbea50372682a53189f96939 100644 (file)
@@ -13,6 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "ClangSACheckers.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/GRStateTrait.h"
@@ -53,10 +54,14 @@ template <> struct GRStateTrait<LockSet> :
 } // end GR namespace
 } // end clang namespace
 
-void ento::registerPthreadLockChecker(ExprEngine &Eng) {
+static void RegisterPthreadLockChecker(ExprEngine &Eng) {
   Eng.registerCheck(new PthreadLockChecker());
 }
 
+void ento::registerPthreadLockChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterPthreadLockChecker);
+}
+
 
 void PthreadLockChecker::PostVisitCallExpr(CheckerContext &C,
                                            const CallExpr *CE) {
index 7d5da0d0fe0df1e4b376405c2b6dac0d709713d1..363f4042db6b9537b889b4e1aebe48f9dc4d9ff2 100644 (file)
@@ -13,6 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "ClangSACheckers.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/GRState.h"
@@ -41,10 +42,14 @@ private:
 };
 }
 
-void ento::registerStackAddrLeakChecker(ExprEngine &Eng) {
+static void RegisterStackAddrLeakChecker(ExprEngine &Eng) {
   Eng.registerCheck(new StackAddrLeakChecker());
 }
 
+void ento::registerStackAddrLeakChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterStackAddrLeakChecker);
+}
+
 SourceRange StackAddrLeakChecker::GenName(llvm::raw_ostream &os,
                                           const MemRegion *R,
                                           SourceManager &SM) {
index 54792f74bd749a3f527ed674321205472c0fa771..2655be28a462052927bae15853b9371665e3bd80 100644 (file)
@@ -12,6 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "ClangSACheckers.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/GRState.h"
@@ -114,10 +115,14 @@ namespace ento {
 }
 }
 
-void ento::registerStreamChecker(ExprEngine &Eng) {
+static void RegisterStreamChecker(ExprEngine &Eng) {
   Eng.registerCheck(new StreamChecker());
 }
 
+void ento::registerStreamChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterStreamChecker);
+}
+
 bool StreamChecker::evalCallExpr(CheckerContext &C, const CallExpr *CE) {
   const GRState *state = C.getState();
   const Expr *Callee = CE->getCallee();
index d7108d432c4703b0e97d532bb5f144c6a47de2ba..a53ebb5ae19c28d2f18768bafba454121b3a746b 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "ClangSACheckers.h"
 #include "clang/Basic/TargetInfo.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 #include "llvm/ADT/Optional.h"
@@ -46,10 +47,14 @@ public:
 };
 } //end anonymous namespace
 
-void ento::registerUnixAPIChecker(ExprEngine &Eng) {
+static void RegisterUnixAPIChecker(ExprEngine &Eng) {
   Eng.registerCheck(new UnixAPIChecker());
 }
 
+void ento::registerUnixAPIChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterUnixAPIChecker);
+}
+
 //===----------------------------------------------------------------------===//
 // Utility functions.
 //===----------------------------------------------------------------------===//
index 6d72e6fb5e39fdbad9d7cde3e4905c50a1f69890..3038e29c0efc927eb8100491a9d2c8cecd826fb6 100644 (file)
@@ -17,6 +17,7 @@
 #include "clang/AST/ParentMap.h"
 #include "clang/Basic/Builtins.h"
 #include "clang/Basic/SourceManager.h"
+#include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerVisitor.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
@@ -54,10 +55,14 @@ void *UnreachableCodeChecker::getTag() {
   return &x;
 }
 
-void ento::registerUnreachableCodeChecker(ExprEngine &Eng) {
+static void RegisterUnreachableCodeChecker(ExprEngine &Eng) {
   Eng.registerCheck(new UnreachableCodeChecker());
 }
 
+void ento::registerUnreachableCodeChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterUnreachableCodeChecker);
+}
+
 void UnreachableCodeChecker::VisitEndAnalysis(ExplodedGraph &G,
                                               BugReporter &B,
                                               ExprEngine &Eng) {