[cfe-commits] r125777 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/ lib/StaticAnalyzer/Checkers/

Argyrios Kyrtzidis akyrtzi at gmail.com
Thu Feb 17 13:39:18 PST 2011


Author: akirtzidis
Date: Thu Feb 17 15:39:17 2011
New Revision: 125777

URL: http://llvm.org/viewvc/llvm-project?rev=125777&view=rev
Log:
[analyzer] Pass CheckerManager to the registration functions.

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

Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h Thu Feb 17 15:39:17 2011
@@ -23,16 +23,16 @@
 
 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

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp Thu Feb 17 15:39:17 2011
@@ -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 @@
 // 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);
+}

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 @@
 }
 }
 
-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.
 //===----------------------------------------------------------------------===//

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 ento::registerCastToStructChecker(ExprEngine &Eng) {
+static void RegisterCastToStructChecker(ExprEngine &Eng) {
   Eng.registerCheck(new CastToStructChecker());
 }
+
+void ento::registerCastToStructChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterCastToStructChecker);
+}

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 @@
 
 } // 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();

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ClangSACheckerProvider.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ClangSACheckerProvider.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ClangSACheckerProvider.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ClangSACheckerProvider.cpp Thu Feb 17 15:39:17 2011
@@ -40,7 +40,7 @@
 
 struct StaticCheckerInfoRec {
   const char *FullName;
-  CheckerManager::RegisterFunc RegFunc;
+  void (*RegFunc)(CheckerManager &mgr);
   bool Hidden;
 };
 
@@ -132,6 +132,6 @@
     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);
   }
 }

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ClangSACheckers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ClangSACheckers.h?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ClangSACheckers.h (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ClangSACheckers.h Thu Feb 17 15:39:17 2011
@@ -18,11 +18,11 @@
 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

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 ento::registerFixedAddressChecker(ExprEngine &Eng) {
+static void RegisterFixedAddressChecker(ExprEngine &Eng) {
   Eng.registerCheck(new FixedAddressChecker());
 }
+
+void ento::registerFixedAddressChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterFixedAddressChecker);
+}

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 @@
   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) {

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 @@
 };
 } //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
 //===----------------------------------------------------------------------===//

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 @@
 } // 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(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterNSAutoreleasePoolChecker);
+}
+
 void
 NSAutoreleasePoolChecker::preVisitObjCMessage(CheckerContext &C,
                                               ObjCMessage msg) {

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 @@
 };
 } // 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) {
 

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 @@
 };
 } // 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 {

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 ento::registerPointerArithChecker(ExprEngine &Eng) {
+static void RegisterPointerArithChecker(ExprEngine &Eng) {
   Eng.registerCheck(new PointerArithChecker());
 }
+
+void ento::registerPointerArithChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterPointerArithChecker);
+}

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 ento::registerPointerSubChecker(ExprEngine &Eng) {
+static void RegisterPointerSubChecker(ExprEngine &Eng) {
   Eng.registerCheck(new PointerSubChecker());
 }
+
+void ento::registerPointerSubChecker(CheckerManager &mgr) {
+  mgr.addCheckerRegisterFunction(RegisterPointerSubChecker);
+}

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 @@
 } // 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) {

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/StackAddrLeakChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/StackAddrLeakChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/StackAddrLeakChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/StackAddrLeakChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 @@
 };
 }
 
-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) {

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 @@
 }
 }
 
-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();

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 @@
 };
 } //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.
 //===----------------------------------------------------------------------===//

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp?rev=125777&r1=125776&r2=125777&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp Thu Feb 17 15:39:17 2011
@@ -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 @@
   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) {





More information about the cfe-commits mailing list