forked from OSchip/llvm-project
[lldb/Core] Remove dead Get*PluginCreateCallbackForPluginName (NFC)
The plugin manager had dedicated Get*PluginCreateCallbackForPluginName methods for each type of plugin, and only a small subset of those were used. This removes the dead duplicated code.
This commit is contained in:
parent
492d4a992d
commit
bad1389f12
|
@ -61,8 +61,6 @@ public:
|
|||
|
||||
static ABICreateInstance GetABICreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static ABICreateInstance GetABICreateCallbackForPluginName(ConstString name);
|
||||
|
||||
// Architecture
|
||||
using ArchitectureCreateInstance =
|
||||
std::unique_ptr<Architecture> (*)(const ArchSpec &);
|
||||
|
@ -112,9 +110,6 @@ public:
|
|||
static JITLoaderCreateInstance
|
||||
GetJITLoaderCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static JITLoaderCreateInstance
|
||||
GetJITLoaderCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
// EmulateInstruction
|
||||
static bool RegisterPlugin(ConstString name, const char *description,
|
||||
EmulateInstructionCreateInstance create_callback);
|
||||
|
@ -149,9 +144,6 @@ public:
|
|||
|
||||
static LanguageCreateInstance GetLanguageCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static LanguageCreateInstance
|
||||
GetLanguageCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
// LanguageRuntime
|
||||
static bool RegisterPlugin(
|
||||
ConstString name, const char *description,
|
||||
|
@ -170,9 +162,6 @@ public:
|
|||
static LanguageRuntimeGetExceptionPrecondition
|
||||
GetLanguageRuntimeGetExceptionPreconditionAtIndex(uint32_t idx);
|
||||
|
||||
static LanguageRuntimeCreateInstance
|
||||
GetLanguageRuntimeCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
// SystemRuntime
|
||||
static bool RegisterPlugin(ConstString name, const char *description,
|
||||
SystemRuntimeCreateInstance create_callback);
|
||||
|
@ -182,9 +171,6 @@ public:
|
|||
static SystemRuntimeCreateInstance
|
||||
GetSystemRuntimeCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static SystemRuntimeCreateInstance
|
||||
GetSystemRuntimeCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
// ObjectFile
|
||||
static bool
|
||||
RegisterPlugin(ConstString name, const char *description,
|
||||
|
@ -204,9 +190,6 @@ public:
|
|||
static ObjectFileGetModuleSpecifications
|
||||
GetObjectFileGetModuleSpecificationsCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static ObjectFileCreateInstance
|
||||
GetObjectFileCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
static ObjectFileCreateMemoryInstance
|
||||
GetObjectFileCreateMemoryCallbackForPluginName(ConstString name);
|
||||
|
||||
|
@ -224,9 +207,6 @@ public:
|
|||
static ObjectContainerCreateInstance
|
||||
GetObjectContainerCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static ObjectContainerCreateInstance
|
||||
GetObjectContainerCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
static ObjectFileGetModuleSpecifications
|
||||
GetObjectContainerGetModuleSpecificationsCallbackAtIndex(uint32_t idx);
|
||||
|
||||
|
@ -326,9 +306,6 @@ public:
|
|||
static StructuredDataPluginCreateInstance
|
||||
GetStructuredDataPluginCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static StructuredDataPluginCreateInstance
|
||||
GetStructuredDataPluginCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
static StructuredDataFilterLaunchInfo
|
||||
GetStructuredDataFilterCallbackAtIndex(uint32_t idx,
|
||||
bool &iteration_complete);
|
||||
|
@ -344,9 +321,6 @@ public:
|
|||
static SymbolFileCreateInstance
|
||||
GetSymbolFileCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static SymbolFileCreateInstance
|
||||
GetSymbolFileCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
// SymbolVendor
|
||||
static bool RegisterPlugin(ConstString name, const char *description,
|
||||
SymbolVendorCreateInstance create_callback);
|
||||
|
@ -356,9 +330,6 @@ public:
|
|||
static SymbolVendorCreateInstance
|
||||
GetSymbolVendorCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static SymbolVendorCreateInstance
|
||||
GetSymbolVendorCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
// UnwindAssembly
|
||||
static bool RegisterPlugin(ConstString name, const char *description,
|
||||
UnwindAssemblyCreateInstance create_callback);
|
||||
|
@ -368,9 +339,6 @@ public:
|
|||
static UnwindAssemblyCreateInstance
|
||||
GetUnwindAssemblyCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static UnwindAssemblyCreateInstance
|
||||
GetUnwindAssemblyCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
// MemoryHistory
|
||||
static bool RegisterPlugin(ConstString name, const char *description,
|
||||
MemoryHistoryCreateInstance create_callback);
|
||||
|
@ -380,9 +348,6 @@ public:
|
|||
static MemoryHistoryCreateInstance
|
||||
GetMemoryHistoryCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static MemoryHistoryCreateInstance
|
||||
GetMemoryHistoryCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
// InstrumentationRuntime
|
||||
static bool
|
||||
RegisterPlugin(ConstString name, const char *description,
|
||||
|
@ -398,9 +363,6 @@ public:
|
|||
static InstrumentationRuntimeCreateInstance
|
||||
GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static InstrumentationRuntimeCreateInstance
|
||||
GetInstrumentationRuntimeCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
// TypeSystem
|
||||
static bool RegisterPlugin(ConstString name, const char *description,
|
||||
TypeSystemCreateInstance create_callback,
|
||||
|
@ -412,9 +374,6 @@ public:
|
|||
static TypeSystemCreateInstance
|
||||
GetTypeSystemCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static TypeSystemCreateInstance
|
||||
GetTypeSystemCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
static LanguageSet GetAllTypeSystemSupportedLanguagesForTypes();
|
||||
|
||||
static LanguageSet GetAllTypeSystemSupportedLanguagesForExpressions();
|
||||
|
@ -428,9 +387,6 @@ public:
|
|||
|
||||
static REPLCreateInstance GetREPLCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static REPLCreateInstance
|
||||
GetREPLCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
static LanguageSet GetREPLAllTypeSystemSupportedLanguages();
|
||||
|
||||
// Some plug-ins might register a DebuggerInitializeCallback callback when
|
||||
|
|
|
@ -268,21 +268,6 @@ ABICreateInstance PluginManager::GetABICreateCallbackAtIndex(uint32_t idx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
ABICreateInstance
|
||||
PluginManager::GetABICreateCallbackForPluginName(ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetABIInstancesMutex());
|
||||
ABIInstances &instances = GetABIInstances();
|
||||
|
||||
ABIInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#pragma mark Architecture
|
||||
|
||||
typedef PluginInstance<PluginManager::ArchitectureCreateInstance>
|
||||
|
@ -537,21 +522,6 @@ PluginManager::GetJITLoaderCreateCallbackAtIndex(uint32_t idx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
JITLoaderCreateInstance
|
||||
PluginManager::GetJITLoaderCreateCallbackForPluginName(ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetJITLoaderMutex());
|
||||
JITLoaderInstances &instances = GetJITLoaderInstances();
|
||||
|
||||
JITLoaderInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#pragma mark EmulateInstruction
|
||||
|
||||
typedef PluginInstance<EmulateInstructionCreateInstance>
|
||||
|
@ -755,21 +725,6 @@ PluginManager::GetLanguageCreateCallbackAtIndex(uint32_t idx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
LanguageCreateInstance
|
||||
PluginManager::GetLanguageCreateCallbackForPluginName(ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetLanguageMutex());
|
||||
LanguageInstances &instances = GetLanguageInstances();
|
||||
|
||||
LanguageInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#pragma mark LanguageRuntime
|
||||
|
||||
struct LanguageRuntimeInstance
|
||||
|
@ -854,21 +809,6 @@ PluginManager::GetLanguageRuntimeGetExceptionPreconditionAtIndex(uint32_t idx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
LanguageRuntimeCreateInstance
|
||||
PluginManager::GetLanguageRuntimeCreateCallbackForPluginName(ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetLanguageRuntimeMutex());
|
||||
LanguageRuntimeInstances &instances = GetLanguageRuntimeInstances();
|
||||
|
||||
LanguageRuntimeInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#pragma mark SystemRuntime
|
||||
|
||||
typedef PluginInstance<SystemRuntimeCreateInstance> SystemRuntimeInstance;
|
||||
|
@ -926,21 +866,6 @@ PluginManager::GetSystemRuntimeCreateCallbackAtIndex(uint32_t idx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
SystemRuntimeCreateInstance
|
||||
PluginManager::GetSystemRuntimeCreateCallbackForPluginName(ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetSystemRuntimeMutex());
|
||||
SystemRuntimeInstances &instances = GetSystemRuntimeInstances();
|
||||
|
||||
SystemRuntimeInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#pragma mark ObjectFile
|
||||
|
||||
struct ObjectFileInstance : public PluginInstance<ObjectFileCreateInstance> {
|
||||
|
@ -1027,21 +952,6 @@ PluginManager::GetObjectFileGetModuleSpecificationsCallbackAtIndex(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
ObjectFileCreateInstance
|
||||
PluginManager::GetObjectFileCreateCallbackForPluginName(ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetObjectFileMutex());
|
||||
ObjectFileInstances &instances = GetObjectFileInstances();
|
||||
|
||||
ObjectFileInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ObjectFileCreateMemoryInstance
|
||||
PluginManager::GetObjectFileCreateMemoryCallbackForPluginName(
|
||||
ConstString name) {
|
||||
|
@ -1136,21 +1046,6 @@ PluginManager::GetObjectContainerCreateCallbackAtIndex(uint32_t idx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
ObjectContainerCreateInstance
|
||||
PluginManager::GetObjectContainerCreateCallbackForPluginName(ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetObjectContainerMutex());
|
||||
ObjectContainerInstances &instances = GetObjectContainerInstances();
|
||||
|
||||
ObjectContainerInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ObjectFileGetModuleSpecifications
|
||||
PluginManager::GetObjectContainerGetModuleSpecificationsCallbackAtIndex(
|
||||
uint32_t idx) {
|
||||
|
@ -1510,23 +1405,6 @@ PluginManager::GetStructuredDataPluginCreateCallbackAtIndex(uint32_t idx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
StructuredDataPluginCreateInstance
|
||||
PluginManager::GetStructuredDataPluginCreateCallbackForPluginName(
|
||||
ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetStructuredDataPluginMutex());
|
||||
StructuredDataPluginInstances &instances =
|
||||
GetStructuredDataPluginInstances();
|
||||
|
||||
StructuredDataPluginInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
StructuredDataFilterLaunchInfo
|
||||
PluginManager::GetStructuredDataFilterCallbackAtIndex(
|
||||
uint32_t idx, bool &iteration_complete) {
|
||||
|
@ -1599,21 +1477,6 @@ PluginManager::GetSymbolFileCreateCallbackAtIndex(uint32_t idx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
SymbolFileCreateInstance
|
||||
PluginManager::GetSymbolFileCreateCallbackForPluginName(ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetSymbolFileMutex());
|
||||
SymbolFileInstances &instances = GetSymbolFileInstances();
|
||||
|
||||
SymbolFileInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#pragma mark SymbolVendor
|
||||
|
||||
typedef PluginInstance<SymbolVendorCreateInstance> SymbolVendorInstance;
|
||||
|
@ -1727,21 +1590,6 @@ PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(uint32_t idx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
UnwindAssemblyCreateInstance
|
||||
PluginManager::GetUnwindAssemblyCreateCallbackForPluginName(ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetUnwindAssemblyMutex());
|
||||
UnwindAssemblyInstances &instances = GetUnwindAssemblyInstances();
|
||||
|
||||
UnwindAssemblyInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#pragma mark MemoryHistory
|
||||
|
||||
typedef PluginInstance<MemoryHistoryCreateInstance> MemoryHistoryInstance;
|
||||
|
@ -1799,21 +1647,6 @@ PluginManager::GetMemoryHistoryCreateCallbackAtIndex(uint32_t idx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
MemoryHistoryCreateInstance
|
||||
PluginManager::GetMemoryHistoryCreateCallbackForPluginName(ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetMemoryHistoryMutex());
|
||||
MemoryHistoryInstances &instances = GetMemoryHistoryInstances();
|
||||
|
||||
MemoryHistoryInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#pragma mark InstrumentationRuntime
|
||||
|
||||
struct InstrumentationRuntimeInstance
|
||||
|
@ -1892,24 +1725,6 @@ PluginManager::GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
InstrumentationRuntimeCreateInstance
|
||||
PluginManager::GetInstrumentationRuntimeCreateCallbackForPluginName(
|
||||
ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(
|
||||
GetInstrumentationRuntimeMutex());
|
||||
InstrumentationRuntimeInstances &instances =
|
||||
GetInstrumentationRuntimeInstances();
|
||||
|
||||
InstrumentationRuntimeInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#pragma mark TypeSystem
|
||||
|
||||
struct TypeSystemInstance : public PluginInstance<TypeSystemCreateInstance> {
|
||||
|
@ -1975,21 +1790,6 @@ PluginManager::GetTypeSystemCreateCallbackAtIndex(uint32_t idx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
TypeSystemCreateInstance
|
||||
PluginManager::GetTypeSystemCreateCallbackForPluginName(ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetTypeSystemMutex());
|
||||
TypeSystemInstances &instances = GetTypeSystemInstances();
|
||||
|
||||
TypeSystemInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
LanguageSet PluginManager::GetAllTypeSystemSupportedLanguagesForTypes() {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetTypeSystemMutex());
|
||||
LanguageSet all;
|
||||
|
@ -2067,21 +1867,6 @@ REPLCreateInstance PluginManager::GetREPLCreateCallbackAtIndex(uint32_t idx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
REPLCreateInstance
|
||||
PluginManager::GetREPLCreateCallbackForPluginName(ConstString name) {
|
||||
if (name) {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetREPLMutex());
|
||||
REPLInstances &instances = GetREPLInstances();
|
||||
|
||||
REPLInstances::iterator pos, end = instances.end();
|
||||
for (pos = instances.begin(); pos != end; ++pos) {
|
||||
if (name == pos->name)
|
||||
return pos->create_callback;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
LanguageSet PluginManager::GetREPLAllTypeSystemSupportedLanguages() {
|
||||
std::lock_guard<std::recursive_mutex> guard(GetREPLMutex());
|
||||
LanguageSet all;
|
||||
|
|
Loading…
Reference in New Issue