Initialization: remove ObjectContainer from Common

This restructures the initialization path to move the ObjectContainer
initialization into the *full* initialization path. This is not needed
for the lldb-server initialization path. This helps strip off ~1MiB
from the binary.

llvm-svn: 359810
This commit is contained in:
Saleem Abdulrasool 2019-05-02 18:11:44 +00:00
parent 2dbd5d84ec
commit c7c3cf685d
3 changed files with 8 additions and 13 deletions

View File

@ -58,6 +58,8 @@
#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h" #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
#include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h" #include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h"
#include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h" #include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h"
#include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h"
#include "Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h"
#include "Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h" #include "Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h"
#include "Plugins/ObjectFile/ELF/ObjectFileELF.h" #include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
#include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h" #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
@ -129,6 +131,9 @@ llvm::Error SystemInitializerFull::Initialize() {
ObjectFileMachO::Initialize(); ObjectFileMachO::Initialize();
ObjectFilePECOFF::Initialize(); ObjectFilePECOFF::Initialize();
ObjectContainerBSDArchive::Initialize();
ObjectContainerUniversalMachO::Initialize();
ScriptInterpreterNone::Initialize(); ScriptInterpreterNone::Initialize();
#ifndef LLDB_DISABLE_PYTHON #ifndef LLDB_DISABLE_PYTHON
@ -360,6 +365,9 @@ void SystemInitializerFull::Terminate() {
ObjectFileMachO::Terminate(); ObjectFileMachO::Terminate();
ObjectFilePECOFF::Terminate(); ObjectFilePECOFF::Terminate();
ObjectContainerBSDArchive::Terminate();
ObjectContainerUniversalMachO::Terminate();
// Now shutdown the common parts, in reverse order. // Now shutdown the common parts, in reverse order.
SystemInitializerCommon::Terminate(); SystemInitializerCommon::Terminate();
} }

View File

@ -17,8 +17,6 @@ add_lldb_library(lldbInitialization
lldbPluginInstructionARM lldbPluginInstructionARM
lldbPluginInstructionMIPS lldbPluginInstructionMIPS
lldbPluginInstructionMIPS64 lldbPluginInstructionMIPS64
lldbPluginObjectContainerBSDArchive
lldbPluginObjectContainerMachOArchive
lldbPluginProcessGDBRemote lldbPluginProcessGDBRemote
${EXTRA_PLUGINS} ${EXTRA_PLUGINS}
${LLDB_SYSTEM_LIBS} ${LLDB_SYSTEM_LIBS}

View File

@ -11,8 +11,6 @@
#include "Plugins/Instruction/ARM/EmulateInstructionARM.h" #include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h" #include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h" #include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
#include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h"
#include "Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h"
#include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h" #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
#include "lldb/Host/FileSystem.h" #include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h" #include "lldb/Host/Host.h"
@ -101,16 +99,10 @@ llvm::Error SystemInitializerCommon::Initialize() {
process_gdb_remote::ProcessGDBRemoteLog::Initialize(); process_gdb_remote::ProcessGDBRemoteLog::Initialize();
// Initialize plug-ins
ObjectContainerBSDArchive::Initialize();
EmulateInstructionARM::Initialize(); EmulateInstructionARM::Initialize();
EmulateInstructionMIPS::Initialize(); EmulateInstructionMIPS::Initialize();
EmulateInstructionMIPS64::Initialize(); EmulateInstructionMIPS64::Initialize();
// Apple/Darwin hosted plugins
ObjectContainerUniversalMachO::Initialize();
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
ProcessPOSIXLog::Initialize(); ProcessPOSIXLog::Initialize();
#endif #endif
@ -124,14 +116,11 @@ llvm::Error SystemInitializerCommon::Initialize() {
void SystemInitializerCommon::Terminate() { void SystemInitializerCommon::Terminate() {
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION); Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
ObjectContainerBSDArchive::Terminate();
EmulateInstructionARM::Terminate(); EmulateInstructionARM::Terminate();
EmulateInstructionMIPS::Terminate(); EmulateInstructionMIPS::Terminate();
EmulateInstructionMIPS64::Terminate(); EmulateInstructionMIPS64::Terminate();
ObjectContainerUniversalMachO::Terminate();
#if defined(_MSC_VER) #if defined(_MSC_VER)
ProcessWindowsLog::Terminate(); ProcessWindowsLog::Terminate();
#endif #endif