[Lldb-commits] [lldb] r359810 - Initialization: remove ObjectContainer from Common

Saleem Abdulrasool via lldb-commits lldb-commits at lists.llvm.org
Thu May 2 11:11:44 PDT 2019


Author: compnerd
Date: Thu May  2 11:11:44 2019
New Revision: 359810

URL: http://llvm.org/viewvc/llvm-project?rev=359810&view=rev
Log:
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.

Modified:
    lldb/trunk/source/API/SystemInitializerFull.cpp
    lldb/trunk/source/Initialization/CMakeLists.txt
    lldb/trunk/source/Initialization/SystemInitializerCommon.cpp

Modified: lldb/trunk/source/API/SystemInitializerFull.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SystemInitializerFull.cpp?rev=359810&r1=359809&r2=359810&view=diff
==============================================================================
--- lldb/trunk/source/API/SystemInitializerFull.cpp (original)
+++ lldb/trunk/source/API/SystemInitializerFull.cpp Thu May  2 11:11:44 2019
@@ -58,6 +58,8 @@
 #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
 #include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.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/ELF/ObjectFileELF.h"
 #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
@@ -129,6 +131,9 @@ llvm::Error SystemInitializerFull::Initi
   ObjectFileMachO::Initialize();
   ObjectFilePECOFF::Initialize();
 
+  ObjectContainerBSDArchive::Initialize();
+  ObjectContainerUniversalMachO::Initialize();
+
   ScriptInterpreterNone::Initialize();
 
 #ifndef LLDB_DISABLE_PYTHON
@@ -360,6 +365,9 @@ void SystemInitializerFull::Terminate()
   ObjectFileMachO::Terminate();
   ObjectFilePECOFF::Terminate();
 
+  ObjectContainerBSDArchive::Terminate();
+  ObjectContainerUniversalMachO::Terminate();
+
   // Now shutdown the common parts, in reverse order.
   SystemInitializerCommon::Terminate();
 }

Modified: lldb/trunk/source/Initialization/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/CMakeLists.txt?rev=359810&r1=359809&r2=359810&view=diff
==============================================================================
--- lldb/trunk/source/Initialization/CMakeLists.txt (original)
+++ lldb/trunk/source/Initialization/CMakeLists.txt Thu May  2 11:11:44 2019
@@ -17,8 +17,6 @@ add_lldb_library(lldbInitialization
     lldbPluginInstructionARM
     lldbPluginInstructionMIPS
     lldbPluginInstructionMIPS64
-    lldbPluginObjectContainerBSDArchive
-    lldbPluginObjectContainerMachOArchive
     lldbPluginProcessGDBRemote
     ${EXTRA_PLUGINS}
     ${LLDB_SYSTEM_LIBS}

Modified: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=359810&r1=359809&r2=359810&view=diff
==============================================================================
--- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp (original)
+++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Thu May  2 11:11:44 2019
@@ -11,8 +11,6 @@
 #include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
 #include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.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 "lldb/Host/FileSystem.h"
 #include "lldb/Host/Host.h"
@@ -101,16 +99,10 @@ llvm::Error SystemInitializerCommon::Ini
 
   process_gdb_remote::ProcessGDBRemoteLog::Initialize();
 
-  // Initialize plug-ins
-  ObjectContainerBSDArchive::Initialize();
-
   EmulateInstructionARM::Initialize();
   EmulateInstructionMIPS::Initialize();
   EmulateInstructionMIPS64::Initialize();
 
-  // Apple/Darwin hosted plugins
-  ObjectContainerUniversalMachO::Initialize();
-
 #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
   ProcessPOSIXLog::Initialize();
 #endif
@@ -124,14 +116,11 @@ llvm::Error SystemInitializerCommon::Ini
 void SystemInitializerCommon::Terminate() {
   static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
   Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
-  ObjectContainerBSDArchive::Terminate();
 
   EmulateInstructionARM::Terminate();
   EmulateInstructionMIPS::Terminate();
   EmulateInstructionMIPS64::Terminate();
 
-  ObjectContainerUniversalMachO::Terminate();
-
 #if defined(_MSC_VER)
   ProcessWindowsLog::Terminate();
 #endif




More information about the lldb-commits mailing list