]> granicus.if.org Git - clang/commitdiff
[analyzer] Remove ManagerRegistry which is not used. In the future we may load analyz...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 14 Feb 2011 18:13:17 +0000 (18:13 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 14 Feb 2011 18:13:17 +0000 (18:13 +0000)
registration through static constructors should be avoided.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125502 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Core/ManagerRegistry.h [deleted file]
lib/StaticAnalyzer/Core/CMakeLists.txt
lib/StaticAnalyzer/Core/ManagerRegistry.cpp [deleted file]
lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp

diff --git a/include/clang/StaticAnalyzer/Core/ManagerRegistry.h b/include/clang/StaticAnalyzer/Core/ManagerRegistry.h
deleted file mode 100644 (file)
index 2858dc4..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//===-- ManagerRegistry.h - Pluggable analyzer module registry --*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the ManagerRegistry and Register* classes.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_GR_MANAGER_REGISTRY_H
-#define LLVM_CLANG_GR_MANAGER_REGISTRY_H
-
-#include "clang/StaticAnalyzer/Core/PathSensitive/GRState.h"
-
-namespace clang {
-
-namespace ento {
-
-/// ManagerRegistry - This class records manager creators registered at
-/// runtime. The information is communicated to AnalysisManager through static
-/// members. Better design is expected.
-
-class ManagerRegistry {
-public:
-  static StoreManagerCreator StoreMgrCreator;
-  static ConstraintManagerCreator ConstraintMgrCreator;
-};
-
-/// RegisterConstraintManager - This class is used to setup the constraint
-/// manager of the static analyzer. The constructor takes a creator function
-/// pointer for creating the constraint manager.
-///
-/// It is used like this:
-///
-/// class MyConstraintManager {};
-/// ConstraintManager* CreateMyConstraintManager(GRStateManager& statemgr) {
-///  return new MyConstraintManager(statemgr);
-/// }
-/// RegisterConstraintManager X(CreateMyConstraintManager);
-
-class RegisterConstraintManager {
-public:
-  RegisterConstraintManager(ConstraintManagerCreator CMC) {
-    assert(ManagerRegistry::ConstraintMgrCreator == 0
-           && "ConstraintMgrCreator already set!");
-    ManagerRegistry::ConstraintMgrCreator = CMC;
-  }
-};
-
-} // end GR namespace
-
-} // end clang namespace
-
-#endif
index a5996ba05e041c4c59d527530cfc72bfde81e39e..357cf31e2711976a8b2871a08392582fea5df248 100644 (file)
@@ -21,7 +21,6 @@ add_clang_library(clangStaticAnalyzerCore
   CoreEngine.cpp
   GRState.cpp
   HTMLDiagnostics.cpp
-  ManagerRegistry.cpp
   MemRegion.cpp
   ObjCMessage.cpp
   PathDiagnostic.cpp
diff --git a/lib/StaticAnalyzer/Core/ManagerRegistry.cpp b/lib/StaticAnalyzer/Core/ManagerRegistry.cpp
deleted file mode 100644 (file)
index 229e51e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-//===- ManagerRegistry.cpp - Pluggble Analyzer module creators --*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//  This file defines the pluggable analyzer module creators.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/StaticAnalyzer/Core/ManagerRegistry.h"
-
-using namespace clang;
-using namespace ento;
-
-StoreManagerCreator ManagerRegistry::StoreMgrCreator = 0;
-
-ConstraintManagerCreator ManagerRegistry::ConstraintMgrCreator = 0;
index 776cd99791d3fc56a520c11fb58abef0ad0f49b0..389fff5ed5932914752daf22a3aa61cde99ad668 100644 (file)
@@ -16,7 +16,6 @@
 #include "clang/StaticAnalyzer/Core/PathSensitive/GRState.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/GRStateTrait.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/TransferFuncs.h"
-#include "clang/StaticAnalyzer/Core/ManagerRegistry.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/ImmutableSet.h"
index 75f475a5bcbfc220c1567d326b463aac545f5508..47c7508f6bff86a95893981912c14beb308948e3 100644 (file)
@@ -21,7 +21,6 @@
 #include "clang/Analysis/Analyses/UninitializedValues.h"
 #include "clang/Analysis/CFG.h"
 #include "clang/StaticAnalyzer/Checkers/LocalCheckers.h"
-#include "clang/StaticAnalyzer/Core/ManagerRegistry.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
@@ -119,29 +118,20 @@ public:
     }
 
     // Create the analyzer component creators.
-    if (ManagerRegistry::StoreMgrCreator != 0) {
-      CreateStoreMgr = ManagerRegistry::StoreMgrCreator;
-    }
-    else {
-      switch (Opts.AnalysisStoreOpt) {
-      default:
-        assert(0 && "Unknown store manager.");
+    switch (Opts.AnalysisStoreOpt) {
+    default:
+      assert(0 && "Unknown store manager.");
 #define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATEFN)           \
-        case NAME##Model: CreateStoreMgr = CREATEFN; break;
+      case NAME##Model: CreateStoreMgr = CREATEFN; break;
 #include "clang/Frontend/Analyses.def"
-      }
     }
 
-    if (ManagerRegistry::ConstraintMgrCreator != 0)
-      CreateConstraintMgr = ManagerRegistry::ConstraintMgrCreator;
-    else {
-      switch (Opts.AnalysisConstraintsOpt) {
-      default:
-        assert(0 && "Unknown store manager.");
+    switch (Opts.AnalysisConstraintsOpt) {
+    default:
+      assert(0 && "Unknown store manager.");
 #define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATEFN)     \
-        case NAME##Model: CreateConstraintMgr = CREATEFN; break;
+      case NAME##Model: CreateConstraintMgr = CREATEFN; break;
 #include "clang/Frontend/Analyses.def"
-      }
     }
   }