Move SafeMachO from Utility to Host
authorPavel Labath <pavel@labath.sk>
Wed, 12 Sep 2018 12:26:05 +0000 (12:26 +0000)
committerPavel Labath <pavel@labath.sk>
Wed, 12 Sep 2018 12:26:05 +0000 (12:26 +0000)
Summary:
One of the conclusions of the discussion on D49740 was that SafeMachO is better
off in the Host module (as that's the only place which should include
mach/machine.h, which is what this header is working around). Also, Utility,
which is the only module which cannot include Host, should not be doing
anything with object file formats.

This patch implements that move, and also removes any unneded includes of that
file.

I've verified that MacOS still compiles after this.

Reviewers: jingham, zturner, teemperor

Subscribers: fedor.sergeev, lldb-commits

Differential Revision: https://reviews.llvm.org/D50383

llvm-svn: 342050

16 files changed:
lldb/include/lldb/Host/SafeMachO.h [moved from lldb/include/lldb/Utility/SafeMachO.h with 100% similarity]
lldb/include/lldb/module.modulemap
lldb/source/Host/common/Symbols.cpp
lldb/source/Host/macosx/Symbols.cpp
lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h
lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h
lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp

index bf43f27..9c7f3e6 100644 (file)
@@ -41,6 +41,7 @@ module lldb_Host {
   module ProcessLauncher { header "Host/ProcessLauncher.h" export * }
   module ProcessRunLock { header "Host/ProcessRunLock.h" export * }
   module PseudoTerminal { header "Host/PseudoTerminal.h" export * }
+  module SafeMachO { header "Host/SafeMachO.h" export * }
   module SocketAddress { header "Host/SocketAddress.h" export * }
   module Socket { header "Host/Socket.h" export * }
   module StringConvert { header "Host/StringConvert.h" export * }
index d7e0c13..6a22860 100644 (file)
@@ -16,7 +16,6 @@
 #include "lldb/Utility/DataBuffer.h"
 #include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
-#include "lldb/Utility/SafeMachO.h"
 #include "lldb/Utility/StreamString.h"
 #include "lldb/Utility/Timer.h"
 #include "lldb/Utility/UUID.h"
@@ -29,7 +28,6 @@ typedef int cpu_subtype_t;
 
 using namespace lldb;
 using namespace lldb_private;
-using namespace llvm::MachO;
 
 #if defined(__APPLE__)
 
index b01c48e..c39756f 100644 (file)
@@ -10,7 +10,6 @@
 #include "lldb/Host/Symbols.h"
 
 // C Includes
-#include "lldb/Utility/SafeMachO.h"
 #include <dirent.h>
 #include <pwd.h>
 
@@ -42,7 +41,6 @@
 
 using namespace lldb;
 using namespace lldb_private;
-using namespace llvm::MachO;
 
 #if !defined(__arm__) && !defined(__arm64__) &&                                \
     !defined(__aarch64__) // No DebugSymbols on the iOS devices
index a39d26a..73408f7 100644 (file)
@@ -11,7 +11,6 @@
 #include "lldb/Host/macosx/HostInfoMacOSX.h"
 #include "lldb/Utility/Args.h"
 #include "lldb/Utility/Log.h"
-#include "lldb/Utility/SafeMachO.h"
 
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/FileSystem.h"
index 75998f1..ead2068 100644 (file)
@@ -18,7 +18,7 @@
 
 // Other libraries and framework includes
 
-#include "lldb/Utility/SafeMachO.h"
+#include "lldb/Host/SafeMachO.h"
 
 // Project includes
 #include "lldb/Target/DynamicLoader.h"
index a02d1ad..3d5dadf 100644 (file)
 
 // Other libraries and framework includes
 // Project includes
+#include "lldb/Host/SafeMachO.h"
 #include "lldb/Target/DynamicLoader.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/SafeMachO.h"
 #include "lldb/Utility/StructuredData.h"
 #include "lldb/Utility/UUID.h"
 
index db90966..ac47a55 100644 (file)
@@ -28,7 +28,6 @@
 #include "lldb/Target/DynamicLoader.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/SafeMachO.h"
 #include "lldb/Utility/StructuredData.h"
 #include "lldb/Utility/UUID.h"
 
index 8b5052e..752d172 100644 (file)
 
 // Other libraries and framework includes
 // Project includes
+#include "lldb/Host/SafeMachO.h"
 #include "lldb/Target/DynamicLoader.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/SafeMachO.h"
 #include "lldb/Utility/StructuredData.h"
 #include "lldb/Utility/UUID.h"
 
index d3c0a08..bd461ae 100644 (file)
@@ -14,9 +14,9 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
+#include "lldb/Host/SafeMachO.h"
 #include "lldb/Symbol/ObjectContainer.h"
 #include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/SafeMachO.h"
 
 class ObjectContainerUniversalMachO : public lldb_private::ObjectContainer {
 public:
index 1bc9be0..653613a 100644 (file)
@@ -46,7 +46,7 @@
 #include "lldb/Utility/Timer.h"
 #include "lldb/Utility/UUID.h"
 
-#include "lldb/Utility/SafeMachO.h"
+#include "lldb/Host/SafeMachO.h"
 
 #include "llvm/Support/MemoryBuffer.h"
 
index be64518..60b98e4 100644 (file)
@@ -17,9 +17,9 @@
 #include "lldb/Core/Address.h"
 #include "lldb/Core/FileSpecList.h"
 #include "lldb/Core/RangeMap.h"
+#include "lldb/Host/SafeMachO.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/SafeMachO.h"
 #include "lldb/Utility/UUID.h"
 
 //----------------------------------------------------------------------
index b1caba0..6f26acd 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "ThreadKDP.h"
 
-#include "lldb/Utility/SafeMachO.h"
+#include "lldb/Host/SafeMachO.h"
 
 #include "lldb/Breakpoint/Watchpoint.h"
 #include "lldb/Target/Process.h"
index c5b4783..0387366 100644 (file)
@@ -28,6 +28,7 @@
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
+#include "lldb/Host/SafeMachO.h"
 #include "lldb/Interpreter/OptionArgParser.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/FileAction.h"
@@ -36,7 +37,6 @@
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/JSON.h"
 #include "lldb/Utility/Log.h"
-#include "lldb/Utility/SafeMachO.h"
 #include "lldb/Utility/StreamGDBRemote.h"
 #include "lldb/Utility/StreamString.h"
 #include "llvm/ADT/Triple.h"
index 1f1f5e5..60a7077 100644 (file)
@@ -39,7 +39,7 @@
 #include "ThreadMachCore.h"
 
 // Needed for the plug-in names for the dynamic loaders.
-#include "lldb/Utility/SafeMachO.h"
+#include "lldb/Host/SafeMachO.h"
 
 #include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h"
 #include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h"
index 6898f53..16edd28 100644 (file)
@@ -9,8 +9,6 @@
 
 #include "ThreadMachCore.h"
 
-#include "lldb/Utility/SafeMachO.h"
-
 #include "lldb/Breakpoint/Watchpoint.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/Process.h"