summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/MacOSX
diff options
context:
space:
mode:
authorEugene Zelenko <eugene.zelenko@gmail.com>2015-11-07 00:28:50 +0000
committerEugene Zelenko <eugene.zelenko@gmail.com>2015-11-07 00:28:50 +0000
commit26f34fb6df5f52a6f8dd8b9659509e2f3a99c4cd (patch)
treedc076949bc3f8cf7f4ed6e23bce671510d95267d /lldb/source/Plugins/Platform/MacOSX
parentba60247a1127d9eabe233eeeb1496b1c3a5f09c5 (diff)
downloadbcm5719-llvm-26f34fb6df5f52a6f8dd8b9659509e2f3a99c4cd.tar.gz
bcm5719-llvm-26f34fb6df5f52a6f8dd8b9659509e2f3a99c4cd.zip
Fix some Clang-tidy warnings and formatting in recently added code.
Fixed Clang-tidy warnings: * modernize-use-override; * modernize-use-nullptr; * modernize-use-default; * readability-simplify-boolean-expr. llvm-svn: 252374
Diffstat (limited to 'lldb/source/Plugins/Platform/MacOSX')
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp103
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h15
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp105
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h15
4 files changed, 101 insertions, 137 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp
index 3eed85f4e0a..4e0b46ec424 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp
@@ -7,12 +7,15 @@
//
//===----------------------------------------------------------------------===//
-#include "PlatformRemoteAppleTV.h"
-
// C Includes
// C++ Includes
+#include <string>
+#include <vector>
+
// Other libraries and framework includes
// Project includes
+#include "PlatformRemoteAppleTV.h"
+
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/ArchSpec.h"
#include "lldb/Core/Error.h"
@@ -29,6 +32,20 @@
using namespace lldb;
using namespace lldb_private;
+//------------------------------------------------------------------
+/// Default Constructor
+//------------------------------------------------------------------
+PlatformRemoteAppleTV::PlatformRemoteAppleTV () :
+ PlatformDarwin (false), // This is a remote platform
+ m_sdk_directory_infos(),
+ m_device_support_directory(),
+ m_device_support_directory_for_os_version (),
+ m_build_update(),
+ m_last_module_sdk_idx (UINT32_MAX),
+ m_connected_module_sdk_idx (UINT32_MAX)
+{
+}
+
PlatformRemoteAppleTV::SDKDirectoryInfo::SDKDirectoryInfo (const lldb_private::FileSpec &sdk_dir) :
directory(sdk_dir),
build(),
@@ -91,7 +108,7 @@ PlatformSP
PlatformRemoteAppleTV::CreateInstance (bool force, const ArchSpec *arch)
{
bool create = force;
- if (create == false && arch && arch->IsValid())
+ if (!create && arch && arch->IsValid())
{
switch (arch->GetMachine())
{
@@ -151,7 +168,6 @@ PlatformRemoteAppleTV::CreateInstance (bool force, const ArchSpec *arch)
return lldb::PlatformSP();
}
-
lldb_private::ConstString
PlatformRemoteAppleTV::GetPluginNameStatic ()
{
@@ -165,32 +181,6 @@ PlatformRemoteAppleTV::GetDescriptionStatic()
return "Remote Apple TV platform plug-in.";
}
-
-//------------------------------------------------------------------
-/// Default Constructor
-//------------------------------------------------------------------
-PlatformRemoteAppleTV::PlatformRemoteAppleTV () :
- PlatformDarwin (false), // This is a remote platform
- m_sdk_directory_infos(),
- m_device_support_directory(),
- m_device_support_directory_for_os_version (),
- m_build_update(),
- m_last_module_sdk_idx (UINT32_MAX),
- m_connected_module_sdk_idx (UINT32_MAX)
-{
-}
-
-//------------------------------------------------------------------
-/// Destructor.
-///
-/// The destructor is virtual since this class is designed to be
-/// inherited from by the plug-in instance.
-//------------------------------------------------------------------
-PlatformRemoteAppleTV::~PlatformRemoteAppleTV()
-{
-}
-
-
void
PlatformRemoteAppleTV::GetStatus (Stream &strm)
{
@@ -211,7 +201,6 @@ PlatformRemoteAppleTV::GetStatus (Stream &strm)
}
}
-
Error
PlatformRemoteAppleTV::ResolveExecutable (const ModuleSpec &ms,
lldb::ModuleSP &exe_module_sp,
@@ -230,11 +219,11 @@ PlatformRemoteAppleTV::ResolveExecutable (const ModuleSpec &ms,
{
if (resolved_module_spec.GetArchitecture().IsValid() || resolved_module_spec.GetUUID().IsValid())
{
- error = ModuleList::GetSharedModule (resolved_module_spec,
- exe_module_sp,
- NULL,
- NULL,
- NULL);
+ error = ModuleList::GetSharedModule(resolved_module_spec,
+ exe_module_sp,
+ nullptr,
+ nullptr,
+ nullptr);
if (exe_module_sp && exe_module_sp->GetObjectFile())
return error;
@@ -246,11 +235,11 @@ PlatformRemoteAppleTV::ResolveExecutable (const ModuleSpec &ms,
StreamString arch_names;
for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, resolved_module_spec.GetArchitecture()); ++idx)
{
- error = ModuleList::GetSharedModule (resolved_module_spec,
- exe_module_sp,
- NULL,
- NULL,
- NULL);
+ error = ModuleList::GetSharedModule(resolved_module_spec,
+ exe_module_sp,
+ nullptr,
+ nullptr,
+ nullptr);
// Did we find an executable using one of the
if (error.Success())
{
@@ -454,13 +443,13 @@ PlatformRemoteAppleTV::GetSDKDirectoryForCurrentOSVersion ()
return &m_sdk_directory_infos[i];
}
}
- return NULL;
+ return nullptr;
}
const PlatformRemoteAppleTV::SDKDirectoryInfo *
PlatformRemoteAppleTV::GetSDKDirectoryForLatestOSVersion ()
{
- const PlatformRemoteAppleTV::SDKDirectoryInfo *result = NULL;
+ const PlatformRemoteAppleTV::SDKDirectoryInfo *result = nullptr;
if (UpdateSDKDirectoryInfosIfNeeded())
{
const uint32_t num_sdk_infos = m_sdk_directory_infos.size();
@@ -470,7 +459,7 @@ PlatformRemoteAppleTV::GetSDKDirectoryForLatestOSVersion ()
const SDKDirectoryInfo &sdk_dir_info = m_sdk_directory_infos[i];
if (sdk_dir_info.version_major != UINT32_MAX)
{
- if (result == NULL || sdk_dir_info.version_major > result->version_major)
+ if (result == nullptr || sdk_dir_info.version_major > result->version_major)
{
result = &sdk_dir_info;
}
@@ -494,8 +483,6 @@ PlatformRemoteAppleTV::GetSDKDirectoryForLatestOSVersion ()
return result;
}
-
-
const char *
PlatformRemoteAppleTV::GetDeviceSupportDirectory()
{
@@ -519,10 +506,9 @@ PlatformRemoteAppleTV::GetDeviceSupportDirectory()
assert (m_device_support_directory.empty() == false);
if (m_device_support_directory[0])
return m_device_support_directory.c_str();
- return NULL;
+ return nullptr;
}
-
const char *
PlatformRemoteAppleTV::GetDeviceSupportDirectoryForOSVersion()
{
@@ -532,7 +518,7 @@ PlatformRemoteAppleTV::GetDeviceSupportDirectoryForOSVersion()
if (m_device_support_directory_for_os_version.empty())
{
const PlatformRemoteAppleTV::SDKDirectoryInfo *sdk_dir_info = GetSDKDirectoryForCurrentOSVersion ();
- if (sdk_dir_info == NULL)
+ if (sdk_dir_info == nullptr)
sdk_dir_info = GetSDKDirectoryForLatestOSVersion ();
if (sdk_dir_info)
{
@@ -555,7 +541,7 @@ PlatformRemoteAppleTV::GetDeviceSupportDirectoryForOSVersion()
assert (m_device_support_directory_for_os_version.empty() == false);
if (m_device_support_directory_for_os_version[0])
return m_device_support_directory_for_os_version.c_str();
- return NULL;
+ return nullptr;
}
uint32_t
@@ -602,7 +588,6 @@ PlatformRemoteAppleTV::GetFileInSDK (const char *platform_file_path,
return false;
}
-
bool
PlatformRemoteAppleTV::GetFileInSDKRoot (const char *platform_file_path,
const char *sdkroot_path,
@@ -648,7 +633,6 @@ PlatformRemoteAppleTV::GetFileInSDKRoot (const char *platform_file_path,
return false;
}
-
Error
PlatformRemoteAppleTV::GetSymbolFile (const FileSpec &platform_file,
const UUID *uuid_ptr,
@@ -741,9 +725,9 @@ PlatformRemoteAppleTV::GetSharedModule (const ModuleSpec &module_spec,
if (GetFileInSDK (platform_file_path, connected_sdk_idx, platform_module_spec.GetFileSpec()))
{
module_sp.reset();
- error = ResolveExecutable (platform_module_spec,
- module_sp,
- NULL);
+ error = ResolveExecutable(platform_module_spec,
+ module_sp,
+ nullptr);
if (module_sp)
{
m_last_module_sdk_idx = connected_sdk_idx;
@@ -760,9 +744,9 @@ PlatformRemoteAppleTV::GetSharedModule (const ModuleSpec &module_spec,
if (GetFileInSDK (platform_file_path, m_last_module_sdk_idx, platform_module_spec.GetFileSpec()))
{
module_sp.reset();
- error = ResolveExecutable (platform_module_spec,
- module_sp,
- NULL);
+ error = ResolveExecutable(platform_module_spec,
+ module_sp,
+ nullptr);
if (module_sp)
{
error.Clear();
@@ -784,7 +768,7 @@ PlatformRemoteAppleTV::GetSharedModule (const ModuleSpec &module_spec,
{
//printf ("sdk[%u]: '%s'\n", sdk_idx, local_file.GetPath().c_str());
- error = ResolveExecutable (platform_module_spec, module_sp, NULL);
+ error = ResolveExecutable(platform_module_spec, module_sp, nullptr);
if (module_sp)
{
// Remember the index of the last SDK that we found a file
@@ -869,7 +853,6 @@ PlatformRemoteAppleTV::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &
default: break;
}
break;
-
}
arch.Clear();
return false;
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h
index b989275ceb5..28bd9df0fad 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h
@@ -12,15 +12,20 @@
// C Includes
// C++ Includes
+#include <string>
+
// Other libraries and framework includes
+// Project includes
#include "lldb/Host/FileSpec.h"
-// Project includes
#include "PlatformDarwin.h"
class PlatformRemoteAppleTV : public PlatformDarwin
{
public:
+ PlatformRemoteAppleTV();
+
+ ~PlatformRemoteAppleTV() override = default;
//------------------------------------------------------------
// Class Functions
@@ -43,11 +48,6 @@ public:
//------------------------------------------------------------
// Class Methods
//------------------------------------------------------------
- PlatformRemoteAppleTV ();
-
- virtual
- ~PlatformRemoteAppleTV();
-
//------------------------------------------------------------
// lldb_private::PluginInterface functions
//------------------------------------------------------------
@@ -166,7 +166,6 @@ protected:
private:
DISALLOW_COPY_AND_ASSIGN (PlatformRemoteAppleTV);
-
};
-#endif // liblldb_PlatformRemoteAppleTV_h_
+#endif // liblldb_PlatformRemoteAppleTV_h_
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp
index 13350921d97..83645b9a212 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp
@@ -7,12 +7,15 @@
//
//===----------------------------------------------------------------------===//
-#include "PlatformRemoteAppleWatch.h"
-
// C Includes
// C++ Includes
+#include <string>
+#include <vector>
+
// Other libraries and framework includes
// Project includes
+#include "PlatformRemoteAppleWatch.h"
+
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/ArchSpec.h"
#include "lldb/Core/Error.h"
@@ -29,6 +32,20 @@
using namespace lldb;
using namespace lldb_private;
+//------------------------------------------------------------------
+/// Default Constructor
+//------------------------------------------------------------------
+PlatformRemoteAppleWatch::PlatformRemoteAppleWatch () :
+ PlatformDarwin (false), // This is a remote platform
+ m_sdk_directory_infos(),
+ m_device_support_directory(),
+ m_device_support_directory_for_os_version (),
+ m_build_update(),
+ m_last_module_sdk_idx (UINT32_MAX),
+ m_connected_module_sdk_idx (UINT32_MAX)
+{
+}
+
PlatformRemoteAppleWatch::SDKDirectoryInfo::SDKDirectoryInfo (const lldb_private::FileSpec &sdk_dir) :
directory(sdk_dir),
build(),
@@ -91,7 +108,7 @@ PlatformSP
PlatformRemoteAppleWatch::CreateInstance (bool force, const ArchSpec *arch)
{
bool create = force;
- if (create == false && arch && arch->IsValid())
+ if (!create && arch && arch->IsValid())
{
switch (arch->GetMachine())
{
@@ -154,13 +171,11 @@ PlatformRemoteAppleWatch::CreateInstance (bool force, const ArchSpec *arch)
}
#endif
-
if (create)
return lldb::PlatformSP(new PlatformRemoteAppleWatch ());
return lldb::PlatformSP();
}
-
lldb_private::ConstString
PlatformRemoteAppleWatch::GetPluginNameStatic ()
{
@@ -174,32 +189,6 @@ PlatformRemoteAppleWatch::GetDescriptionStatic()
return "Remote Apple Watch platform plug-in.";
}
-
-//------------------------------------------------------------------
-/// Default Constructor
-//------------------------------------------------------------------
-PlatformRemoteAppleWatch::PlatformRemoteAppleWatch () :
- PlatformDarwin (false), // This is a remote platform
- m_sdk_directory_infos(),
- m_device_support_directory(),
- m_device_support_directory_for_os_version (),
- m_build_update(),
- m_last_module_sdk_idx (UINT32_MAX),
- m_connected_module_sdk_idx (UINT32_MAX)
-{
-}
-
-//------------------------------------------------------------------
-/// Destructor.
-///
-/// The destructor is virtual since this class is designed to be
-/// inherited from by the plug-in instance.
-//------------------------------------------------------------------
-PlatformRemoteAppleWatch::~PlatformRemoteAppleWatch()
-{
-}
-
-
void
PlatformRemoteAppleWatch::GetStatus (Stream &strm)
{
@@ -220,7 +209,6 @@ PlatformRemoteAppleWatch::GetStatus (Stream &strm)
}
}
-
Error
PlatformRemoteAppleWatch::ResolveExecutable (const ModuleSpec &ms,
lldb::ModuleSP &exe_module_sp,
@@ -239,11 +227,11 @@ PlatformRemoteAppleWatch::ResolveExecutable (const ModuleSpec &ms,
{
if (resolved_module_spec.GetArchitecture().IsValid() || resolved_module_spec.GetUUID().IsValid())
{
- error = ModuleList::GetSharedModule (resolved_module_spec,
- exe_module_sp,
- NULL,
- NULL,
- NULL);
+ error = ModuleList::GetSharedModule(resolved_module_spec,
+ exe_module_sp,
+ nullptr,
+ nullptr,
+ nullptr);
if (exe_module_sp && exe_module_sp->GetObjectFile())
return error;
@@ -255,11 +243,11 @@ PlatformRemoteAppleWatch::ResolveExecutable (const ModuleSpec &ms,
StreamString arch_names;
for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, resolved_module_spec.GetArchitecture()); ++idx)
{
- error = ModuleList::GetSharedModule (resolved_module_spec,
- exe_module_sp,
- NULL,
- NULL,
- NULL);
+ error = ModuleList::GetSharedModule(resolved_module_spec,
+ exe_module_sp,
+ nullptr,
+ nullptr,
+ nullptr);
// Did we find an executable using one of the
if (error.Success())
{
@@ -455,13 +443,13 @@ PlatformRemoteAppleWatch::GetSDKDirectoryForCurrentOSVersion ()
return &m_sdk_directory_infos[i];
}
}
- return NULL;
+ return nullptr;
}
const PlatformRemoteAppleWatch::SDKDirectoryInfo *
PlatformRemoteAppleWatch::GetSDKDirectoryForLatestOSVersion ()
{
- const PlatformRemoteAppleWatch::SDKDirectoryInfo *result = NULL;
+ const PlatformRemoteAppleWatch::SDKDirectoryInfo *result = nullptr;
if (UpdateSDKDirectoryInfosIfNeeded())
{
const uint32_t num_sdk_infos = m_sdk_directory_infos.size();
@@ -471,7 +459,7 @@ PlatformRemoteAppleWatch::GetSDKDirectoryForLatestOSVersion ()
const SDKDirectoryInfo &sdk_dir_info = m_sdk_directory_infos[i];
if (sdk_dir_info.version_major != UINT32_MAX)
{
- if (result == NULL || sdk_dir_info.version_major > result->version_major)
+ if (result == nullptr || sdk_dir_info.version_major > result->version_major)
{
result = &sdk_dir_info;
}
@@ -495,8 +483,6 @@ PlatformRemoteAppleWatch::GetSDKDirectoryForLatestOSVersion ()
return result;
}
-
-
const char *
PlatformRemoteAppleWatch::GetDeviceSupportDirectory()
{
@@ -531,9 +517,8 @@ PlatformRemoteAppleWatch::GetDeviceSupportDirectory()
assert (m_device_support_directory.empty() == false);
if (m_device_support_directory[0])
return m_device_support_directory.c_str();
- return NULL;
+ return nullptr;
}
-
const char *
PlatformRemoteAppleWatch::GetDeviceSupportDirectoryForOSVersion()
@@ -544,7 +529,7 @@ PlatformRemoteAppleWatch::GetDeviceSupportDirectoryForOSVersion()
if (m_device_support_directory_for_os_version.empty())
{
const PlatformRemoteAppleWatch::SDKDirectoryInfo *sdk_dir_info = GetSDKDirectoryForCurrentOSVersion ();
- if (sdk_dir_info == NULL)
+ if (sdk_dir_info == nullptr)
sdk_dir_info = GetSDKDirectoryForLatestOSVersion ();
if (sdk_dir_info)
{
@@ -567,7 +552,7 @@ PlatformRemoteAppleWatch::GetDeviceSupportDirectoryForOSVersion()
assert (m_device_support_directory_for_os_version.empty() == false);
if (m_device_support_directory_for_os_version[0])
return m_device_support_directory_for_os_version.c_str();
- return NULL;
+ return nullptr;
}
uint32_t
@@ -614,7 +599,6 @@ PlatformRemoteAppleWatch::GetFileInSDK (const char *platform_file_path,
return false;
}
-
bool
PlatformRemoteAppleWatch::GetFileInSDKRoot (const char *platform_file_path,
const char *sdkroot_path,
@@ -660,7 +644,6 @@ PlatformRemoteAppleWatch::GetFileInSDKRoot (const char *platform_file_path,
return false;
}
-
Error
PlatformRemoteAppleWatch::GetSymbolFile (const FileSpec &platform_file,
const UUID *uuid_ptr,
@@ -753,9 +736,9 @@ PlatformRemoteAppleWatch::GetSharedModule (const ModuleSpec &module_spec,
if (GetFileInSDK (platform_file_path, connected_sdk_idx, platform_module_spec.GetFileSpec()))
{
module_sp.reset();
- error = ResolveExecutable (platform_module_spec,
- module_sp,
- NULL);
+ error = ResolveExecutable(platform_module_spec,
+ module_sp,
+ nullptr);
if (module_sp)
{
m_last_module_sdk_idx = connected_sdk_idx;
@@ -772,9 +755,9 @@ PlatformRemoteAppleWatch::GetSharedModule (const ModuleSpec &module_spec,
if (GetFileInSDK (platform_file_path, m_last_module_sdk_idx, platform_module_spec.GetFileSpec()))
{
module_sp.reset();
- error = ResolveExecutable (platform_module_spec,
- module_sp,
- NULL);
+ error = ResolveExecutable(platform_module_spec,
+ module_sp,
+ nullptr);
if (module_sp)
{
error.Clear();
@@ -796,7 +779,7 @@ PlatformRemoteAppleWatch::GetSharedModule (const ModuleSpec &module_spec,
{
//printf ("sdk[%u]: '%s'\n", sdk_idx, local_file.GetPath().c_str());
- error = ResolveExecutable (platform_module_spec, module_sp, NULL);
+ error = ResolveExecutable(platform_module_spec, module_sp, nullptr);
if (module_sp)
{
// Remember the index of the last SDK that we found a file
@@ -902,7 +885,6 @@ PlatformRemoteAppleWatch::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpe
default: break;
}
break;
-
}
arch.Clear();
return false;
@@ -936,4 +918,3 @@ PlatformRemoteAppleWatch::GetConnectedSDKIndex ()
}
return m_connected_module_sdk_idx;
}
-
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h
index a075cc6fea7..891bc5d1c6e 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h
@@ -12,15 +12,21 @@
// C Includes
// C++ Includes
+#include <string>
+#include <vector>
+
// Other libraries and framework includes
+// Project includes
#include "lldb/Host/FileSpec.h"
-// Project includes
#include "PlatformDarwin.h"
class PlatformRemoteAppleWatch : public PlatformDarwin
{
public:
+ PlatformRemoteAppleWatch();
+
+ ~PlatformRemoteAppleWatch() override = default;
//------------------------------------------------------------
// Class Functions
@@ -43,10 +49,6 @@ public:
//------------------------------------------------------------
// Class Methods
//------------------------------------------------------------
- PlatformRemoteAppleWatch ();
-
- virtual
- ~PlatformRemoteAppleWatch();
//------------------------------------------------------------
// lldb_private::PluginInterface functions
@@ -166,7 +168,6 @@ protected:
private:
DISALLOW_COPY_AND_ASSIGN (PlatformRemoteAppleWatch);
-
};
-#endif // liblldb_PlatformRemoteAppleWatch_h_
+#endif // liblldb_PlatformRemoteAppleWatch_h_
OpenPOWER on IntegriCloud