Move SafeMachO from Utility to Host

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
This commit is contained in:
Pavel Labath 2018-09-12 12:26:05 +00:00
parent 2d77e788f2
commit 7704473172
16 changed files with 10 additions and 17 deletions

View 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 * }

View 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__)

View 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

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

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

View File

@ -18,10 +18,10 @@
// 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"

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

View File

@ -28,10 +28,10 @@
// 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"

View 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:

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

View 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"
//----------------------------------------------------------------------

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

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

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

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