[analyzer] Remove ManagerRegistry which is not used. In the future we may load analyzer plugins dynamically but

registration through static constructors should be avoided.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125502 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Argyrios Kyrtzidis 2011-02-14 18:13:17 +00:00
Родитель e6348c336f
Коммит 5f83d6f36a
5 изменённых файлов: 8 добавлений и 99 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -21,7 +21,6 @@ add_clang_library(clangStaticAnalyzerCore
CoreEngine.cpp
GRState.cpp
HTMLDiagnostics.cpp
ManagerRegistry.cpp
MemRegion.cpp
ObjCMessage.cpp
PathDiagnostic.cpp

Просмотреть файл

@ -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;

Просмотреть файл

@ -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"

Просмотреть файл

@ -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"
}
}
}