[Lldb-commits] [lldb] r263300 - Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.

Eugene Zelenko via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 11 13:55:48 PST 2016


Author: eugenezelenko
Date: Fri Mar 11 15:55:47 2016
New Revision: 263300

URL: http://llvm.org/viewvc/llvm-project?rev=263300&view=rev
Log:
Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.

Modified:
    lldb/trunk/source/Core/Logging.cpp
    lldb/trunk/source/Core/Opcode.cpp
    lldb/trunk/source/Core/PluginManager.cpp

Modified: lldb/trunk/source/Core/Logging.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Logging.cpp?rev=263300&r1=263299&r2=263300&view=diff
==============================================================================
--- lldb/trunk/source/Core/Logging.cpp (original)
+++ lldb/trunk/source/Core/Logging.cpp Fri Mar 11 15:55:47 2016
@@ -11,30 +11,31 @@
 
 // C Includes
 // C++ Includes
+#include <cstring>
 #include <atomic>
+
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/StreamFile.h"
-#include <string.h>
 
 using namespace lldb;
 using namespace lldb_private;
 
-
 // We want to avoid global constructors where code needs to be run so here we
 // control access to our static g_log_sp by hiding it in a singleton function
 // that will construct the static g_lob_sp the first time this function is
 // called.
 
 static std::atomic<bool> g_log_enabled {false};
-static Log * g_log = NULL;
+static Log * g_log = nullptr;
+
 static Log *
 GetLog ()
 {
     if (!g_log_enabled)
-        return NULL;
+        return nullptr;
     return g_log;
 }
 
@@ -62,7 +63,7 @@ lldb_private::GetLogIfAllCategoriesSet (
     {
         uint32_t log_mask = log->GetMask().Get();
         if ((log_mask & mask) != mask)
-            return NULL;
+            return nullptr;
     }
     return log;
 }
@@ -84,7 +85,7 @@ void
 lldb_private::LogIfAnyCategoriesSet (uint32_t mask, const char *format, ...)
 {
     Log *log(GetLogIfAnyCategoriesSet (mask));
-    if (log)
+    if (log != nullptr)
     {
         va_list args;
         va_start (args, format);
@@ -97,9 +98,9 @@ Log *
 lldb_private::GetLogIfAnyCategoriesSet (uint32_t mask)
 {
     Log *log(GetLog ());
-    if (log && mask && (mask & log->GetMask().Get()))
+    if (log != nullptr && mask && (mask & log->GetMask().Get()))
         return log;
-    return NULL;
+    return nullptr;
 }
 
 void
@@ -107,13 +108,13 @@ lldb_private::DisableLog (const char **c
 {
     Log *log(GetLog ());
 
-    if (log)
+    if (log != nullptr)
     {
         uint32_t flag_bits = 0;
-        if (categories[0] != NULL)
+        if (categories[0] != nullptr)
         {
             flag_bits = log->GetMask().Get();
-            for (size_t i = 0; categories[i] != NULL; ++i)
+            for (size_t i = 0; categories[i] != nullptr; ++i)
             {
                 const char *arg = categories[i];
 
@@ -164,8 +165,6 @@ lldb_private::DisableLog (const char **c
             g_log_enabled = false;
         }
     }
-
-    return;
 }
 
 Log *
@@ -174,7 +173,7 @@ lldb_private::EnableLog (StreamSP &log_s
     // Try see if there already is a log - that way we can reuse its settings.
     // We could reuse the log in toto, but we don't know that the stream is the same.
     uint32_t flag_bits;
-    if (g_log)
+    if (g_log != nullptr)
         flag_bits = g_log->GetMask().Get();
     else
         flag_bits = 0;
@@ -182,15 +181,15 @@ lldb_private::EnableLog (StreamSP &log_s
     // Now make a new log with this stream if one was provided
     if (log_stream_sp)
     {
-        if (g_log)
+        if (g_log != nullptr)
             g_log->SetStream(log_stream_sp);
         else
             g_log = new Log(log_stream_sp);
     }
 
-    if (g_log)
+    if (g_log != nullptr)
     {
-        for (size_t i=0; categories[i] != NULL; ++i)
+        for (size_t i = 0; categories[i] != nullptr; ++i)
         {
             const char *arg = categories[i];
 
@@ -241,7 +240,6 @@ lldb_private::EnableLog (StreamSP &log_s
     return g_log;
 }
 
-
 void
 lldb_private::ListLogCategories (Stream *strm)
 {

Modified: lldb/trunk/source/Core/Opcode.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Opcode.cpp?rev=263300&r1=263299&r2=263300&view=diff
==============================================================================
--- lldb/trunk/source/Core/Opcode.cpp (original)
+++ lldb/trunk/source/Core/Opcode.cpp Fri Mar 11 15:55:47 2016
@@ -13,6 +13,7 @@
 // C++ Includes
 // Other libraries and framework includes
 #include "llvm/ADT/Triple.h"
+
 // Project includes
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/DataBufferHeap.h"
@@ -20,11 +21,9 @@
 #include "lldb/Core/Stream.h"
 #include "lldb/Host/Endian.h"
 
-
 using namespace lldb;
 using namespace lldb_private;
 
-
 int
 Opcode::Dump (Stream *s, uint32_t min_byte_width)
 {
@@ -50,13 +49,11 @@ Opcode::Dump (Stream *s, uint32_t min_by
         break;
 
     case Opcode::eTypeBytes:
+        for (uint32_t i = 0; i < m_data.inst.length; ++i)
         {
-            for (uint32_t i=0; i<m_data.inst.length; ++i)
-            {
-                if (i > 0)
-                    bytes_written += s->PutChar (' ');
-                bytes_written += s->Printf ("%2.2x", m_data.inst.bytes[i]);
-            }
+            if (i > 0)
+                bytes_written += s->PutChar (' ');
+            bytes_written += s->Printf ("%2.2x", m_data.inst.bytes[i]);
         }
         break;
     }
@@ -94,7 +91,7 @@ Opcode::GetData (DataExtractor &data) co
 {
     uint32_t byte_size = GetByteSize ();
     uint8_t swap_buf[8];
-    const void *buf = NULL;
+    const void *buf = nullptr;
 
     if (byte_size > 0)
     {
@@ -148,7 +145,7 @@ Opcode::GetData (DataExtractor &data) co
             }
         }
     }
-    if (buf)
+    if (buf != nullptr)
     {
         DataBufferSP buffer_sp;
 
@@ -160,6 +157,3 @@ Opcode::GetData (DataExtractor &data) co
     data.Clear();
     return 0;
 }
-
-
-

Modified: lldb/trunk/source/Core/PluginManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=263300&r1=263299&r2=263300&view=diff
==============================================================================
--- lldb/trunk/source/Core/PluginManager.cpp (original)
+++ lldb/trunk/source/Core/PluginManager.cpp Fri Mar 11 15:55:47 2016
@@ -9,11 +9,17 @@
 
 #include "lldb/Core/PluginManager.h"
 
-#include <limits.h>
-
+// C Includes
+// C++ Includes
+#include <climits>
 #include <string>
 #include <vector>
 
+// Other libraries and framework includes
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/DynamicLibrary.h"
+
+// Project includes
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Error.h"
 #include "lldb/Host/FileSpec.h"
@@ -22,9 +28,6 @@
 #include "lldb/Host/Mutex.h"
 #include "lldb/Interpreter/OptionValueProperties.h"
 
-#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/DynamicLibrary.h"
-
 using namespace lldb;
 using namespace lldb_private;
 
@@ -35,9 +38,8 @@ enum PluginAction
     ePluginGetInstanceAtIndex
 };
 
-
-typedef bool (*PluginInitCallback) (void);
-typedef void (*PluginTermCallback) (void);
+typedef bool (*PluginInitCallback)();
+typedef void (*PluginTermCallback)();
 
 struct PluginInfo
 {
@@ -92,12 +94,9 @@ CastToFPtr (void *VPtr)
 }
 
 static FileSpec::EnumerateDirectoryResult 
-LoadPluginCallback 
-(
-    void *baton,
-    FileSpec::FileType file_type,
-    const FileSpec &file_spec
-)
+LoadPluginCallback(void *baton,
+                   FileSpec::FileType file_type,
+                   const FileSpec &file_spec)
 {
 //    PluginManager *plugin_manager = (PluginManager *)baton;
     Error error;
@@ -134,7 +133,7 @@ LoadPluginCallback
 
                 if (success)
                 {
-                    // It is ok for the "LLDBPluginTerminate" symbol to be NULL
+                    // It is ok for the "LLDBPluginTerminate" symbol to be nullptr
                     plugin_info.plugin_term_callback =
                         CastToFPtr<PluginTermCallback>(plugin_info.library.getAddressOfSymbol("LLDBPluginTerminate"));
                 }
@@ -170,7 +169,6 @@ LoadPluginCallback
     return FileSpec::eEnumerateDirectoryResultNext;
 }
 
-
 void
 PluginManager::Initialize ()
 {
@@ -184,12 +182,12 @@ PluginManager::Initialize ()
     {
         if (dir_spec.Exists() && dir_spec.GetPath(dir_path, sizeof(dir_path)))
         {
-            FileSpec::EnumerateDirectory (dir_path, 
-                                          find_directories,
-                                          find_files,
-                                          find_other,
-                                          LoadPluginCallback,
-                                          NULL);
+            FileSpec::EnumerateDirectory(dir_path,
+                                         find_directories,
+                                         find_files,
+                                         find_other,
+                                         LoadPluginCallback,
+                                         nullptr);
         }
     }
 
@@ -197,12 +195,12 @@ PluginManager::Initialize ()
     {
         if (dir_spec.Exists() && dir_spec.GetPath(dir_path, sizeof(dir_path)))
         {
-            FileSpec::EnumerateDirectory (dir_path, 
-                                          find_directories,
-                                          find_files,
-                                          find_other,
-                                          LoadPluginCallback,
-                                          NULL);
+            FileSpec::EnumerateDirectory(dir_path,
+                                         find_directories,
+                                         find_files,
+                                         find_other,
+                                         LoadPluginCallback,
+                                         nullptr);
         }
     }
 #endif
@@ -218,7 +216,7 @@ PluginManager::Terminate ()
     for (pos = plugin_map.begin(); pos != end; ++pos)
     {
         // Call the plug-in "void LLDBPluginTerminate (void)" function if there
-        // is one (if the symbol was not NULL).
+        // is one (if the symbol was not nullptr).
         if (pos->second.library.isValid())
         {
             if (pos->second.plugin_term_callback)
@@ -228,16 +226,14 @@ PluginManager::Terminate ()
     plugin_map.clear();
 }
 
-
 #pragma mark ABI
 
-
 struct ABIInstance
 {
     ABIInstance() :
         name(),
         description(),
-        create_callback(NULL)
+        create_callback(nullptr)
     {
     }
 
@@ -263,12 +259,9 @@ GetABIInstances ()
 }
 
 bool
-PluginManager::RegisterPlugin
-(
-    const ConstString &name,
-    const char *description,
-    ABICreateInstance create_callback
-)
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              ABICreateInstance create_callback)
 {
     if (create_callback)
     {
@@ -313,7 +306,7 @@ PluginManager::GetABICreateCallbackAtInd
     ABIInstances &instances = GetABIInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 ABICreateInstance
@@ -331,19 +324,17 @@ PluginManager::GetABICreateCallbackForPl
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
-
 #pragma mark Disassembler
 
-
 struct DisassemblerInstance
 {
     DisassemblerInstance() :
         name(),
         description(),
-        create_callback(NULL)
+        create_callback(nullptr)
     {
     }
 
@@ -369,12 +360,9 @@ GetDisassemblerInstances ()
 }
 
 bool
-PluginManager::RegisterPlugin
-(
-    const ConstString &name,
-    const char *description,
-    DisassemblerCreateInstance create_callback
-)
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              DisassemblerCreateInstance create_callback)
 {
     if (create_callback)
     {
@@ -419,7 +407,7 @@ PluginManager::GetDisassemblerCreateCall
     DisassemblerInstances &instances = GetDisassemblerInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 DisassemblerCreateInstance
@@ -437,21 +425,18 @@ PluginManager::GetDisassemblerCreateCall
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
-
-
 #pragma mark DynamicLoader
 
-
 struct DynamicLoaderInstance
 {
     DynamicLoaderInstance() :
         name(),
         description(),
-        create_callback(NULL),
-        debugger_init_callback (NULL)
+        create_callback(nullptr),
+        debugger_init_callback(nullptr)
     {
     }
 
@@ -463,7 +448,6 @@ struct DynamicLoaderInstance
 
 typedef std::vector<DynamicLoaderInstance> DynamicLoaderInstances;
 
-
 static Mutex &
 GetDynamicLoaderMutex ()
 {
@@ -478,15 +462,11 @@ GetDynamicLoaderInstances ()
     return g_instances;
 }
 
-
 bool
-PluginManager::RegisterPlugin
-(
-    const ConstString &name,
-    const char *description,
-    DynamicLoaderCreateInstance create_callback,
-    DebuggerInitializeCallback debugger_init_callback
-)
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              DynamicLoaderCreateInstance create_callback,
+                              DebuggerInitializeCallback debugger_init_callback)
 {
     if (create_callback)
     {
@@ -531,7 +511,7 @@ PluginManager::GetDynamicLoaderCreateCal
     DynamicLoaderInstances &instances = GetDynamicLoaderInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 DynamicLoaderCreateInstance
@@ -549,19 +529,18 @@ PluginManager::GetDynamicLoaderCreateCal
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 #pragma mark JITLoader
 
-
 struct JITLoaderInstance
 {
     JITLoaderInstance() :
         name(),
         description(),
-        create_callback(NULL),
-        debugger_init_callback (NULL)
+        create_callback(nullptr),
+        debugger_init_callback(nullptr)
     {
     }
 
@@ -573,7 +552,6 @@ struct JITLoaderInstance
 
 typedef std::vector<JITLoaderInstance> JITLoaderInstances;
 
-
 static Mutex &
 GetJITLoaderMutex ()
 {
@@ -588,15 +566,11 @@ GetJITLoaderInstances ()
     return g_instances;
 }
 
-
 bool
-PluginManager::RegisterPlugin
-(
-    const ConstString &name,
-    const char *description,
-    JITLoaderCreateInstance create_callback,
-    DebuggerInitializeCallback debugger_init_callback
-)
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              JITLoaderCreateInstance create_callback,
+                              DebuggerInitializeCallback debugger_init_callback)
 {
     if (create_callback)
     {
@@ -641,7 +615,7 @@ PluginManager::GetJITLoaderCreateCallbac
     JITLoaderInstances &instances = GetJITLoaderInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 JITLoaderCreateInstance
@@ -659,18 +633,17 @@ PluginManager::GetJITLoaderCreateCallbac
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 #pragma mark EmulateInstruction
 
-
 struct EmulateInstructionInstance
 {
     EmulateInstructionInstance() :
-    name(),
-    description(),
-    create_callback(NULL)
+        name(),
+        description(),
+        create_callback(nullptr)
     {
     }
     
@@ -695,14 +668,10 @@ GetEmulateInstructionInstances ()
     return g_instances;
 }
 
-
 bool
-PluginManager::RegisterPlugin
-(
-    const ConstString &name,
-    const char *description,
-    EmulateInstructionCreateInstance create_callback
-)
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              EmulateInstructionCreateInstance create_callback)
 {
     if (create_callback)
     {
@@ -746,7 +715,7 @@ PluginManager::GetEmulateInstructionCrea
     EmulateInstructionInstances &instances = GetEmulateInstructionInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 EmulateInstructionCreateInstance
@@ -764,10 +733,10 @@ PluginManager::GetEmulateInstructionCrea
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
-#pragma mark OperatingSystem
 
+#pragma mark OperatingSystem
 
 struct OperatingSystemInstance
 {
@@ -849,7 +818,7 @@ PluginManager::GetOperatingSystemCreateC
     OperatingSystemInstances &instances = GetOperatingSystemInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 OperatingSystemCreateInstance
@@ -867,19 +836,17 @@ PluginManager::GetOperatingSystemCreateC
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
-
 #pragma mark Language
 
-
 struct LanguageInstance
 {
     LanguageInstance() :
         name(),
         description(),
-        create_callback(NULL)
+        create_callback(nullptr)
     {
     }
     
@@ -905,12 +872,9 @@ GetLanguageInstances ()
 }
 
 bool
-PluginManager::RegisterPlugin
-(
- const ConstString &name,
- const char *description,
- LanguageCreateInstance create_callback
- )
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              LanguageCreateInstance create_callback)
 {
     if (create_callback)
     {
@@ -954,7 +918,7 @@ PluginManager::GetLanguageCreateCallback
     LanguageInstances &instances = GetLanguageInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 LanguageCreateInstance
@@ -972,19 +936,17 @@ PluginManager::GetLanguageCreateCallback
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
-
 #pragma mark LanguageRuntime
 
-
 struct LanguageRuntimeInstance
 {
     LanguageRuntimeInstance() :
         name(),
         description(),
-        create_callback(NULL)
+        create_callback(nullptr)
     {
     }
 
@@ -1011,13 +973,10 @@ GetLanguageRuntimeInstances ()
 }
 
 bool
-PluginManager::RegisterPlugin
-(
-    const ConstString &name,
-    const char *description,
-    LanguageRuntimeCreateInstance create_callback,
-    LanguageRuntimeGetCommandObject command_callback
-)
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              LanguageRuntimeCreateInstance create_callback,
+                              LanguageRuntimeGetCommandObject command_callback)
 {
     if (create_callback)
     {
@@ -1062,7 +1021,7 @@ PluginManager::GetLanguageRuntimeCreateC
     LanguageRuntimeInstances &instances = GetLanguageRuntimeInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 LanguageRuntimeGetCommandObject
@@ -1072,7 +1031,7 @@ PluginManager::GetLanguageRuntimeGetComm
     LanguageRuntimeInstances &instances = GetLanguageRuntimeInstances ();
     if (idx < instances.size())
         return instances[idx].command_callback;
-    return NULL;
+    return nullptr;
 }
 
 LanguageRuntimeCreateInstance
@@ -1090,18 +1049,17 @@ PluginManager::GetLanguageRuntimeCreateC
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 #pragma mark SystemRuntime
 
-
 struct SystemRuntimeInstance
 {
     SystemRuntimeInstance() :
         name(),
         description(),
-        create_callback(NULL)
+        create_callback(nullptr)
     {
     }
 
@@ -1127,12 +1085,9 @@ GetSystemRuntimeInstances ()
 }
 
 bool
-PluginManager::RegisterPlugin
-(
-    const ConstString &name,
-    const char *description,
-    SystemRuntimeCreateInstance create_callback
-)
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              SystemRuntimeCreateInstance create_callback)
 {
     if (create_callback)
     {
@@ -1176,7 +1131,7 @@ PluginManager::GetSystemRuntimeCreateCal
     SystemRuntimeInstances &instances = GetSystemRuntimeInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 SystemRuntimeCreateInstance
@@ -1194,10 +1149,9 @@ PluginManager::GetSystemRuntimeCreateCal
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
-
 #pragma mark ObjectFile
 
 struct ObjectFileInstance
@@ -1205,10 +1159,10 @@ struct ObjectFileInstance
     ObjectFileInstance() :
         name(),
         description(),
-        create_callback(NULL),
-        create_memory_callback (NULL),
-        get_module_specifications (NULL),
-        save_core (NULL)
+        create_callback(nullptr),
+        create_memory_callback(nullptr),
+        get_module_specifications(nullptr),
+        save_core(nullptr)
     {
     }
 
@@ -1236,7 +1190,6 @@ GetObjectFileInstances ()
     return g_instances;
 }
 
-
 bool
 PluginManager::RegisterPlugin (const ConstString &name,
                                const char *description,
@@ -1290,10 +1243,9 @@ PluginManager::GetObjectFileCreateCallba
     ObjectFileInstances &instances = GetObjectFileInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
-
 ObjectFileCreateMemoryInstance
 PluginManager::GetObjectFileCreateMemoryCallbackAtIndex (uint32_t idx)
 {
@@ -1301,7 +1253,7 @@ PluginManager::GetObjectFileCreateMemory
     ObjectFileInstances &instances = GetObjectFileInstances ();
     if (idx < instances.size())
         return instances[idx].create_memory_callback;
-    return NULL;
+    return nullptr;
 }
 
 ObjectFileGetModuleSpecifications
@@ -1311,7 +1263,7 @@ PluginManager::GetObjectFileGetModuleSpe
     ObjectFileInstances &instances = GetObjectFileInstances ();
     if (idx < instances.size())
         return instances[idx].get_module_specifications;
-    return NULL;
+    return nullptr;
 }
 
 ObjectFileCreateInstance
@@ -1329,10 +1281,9 @@ PluginManager::GetObjectFileCreateCallba
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
-
 ObjectFileCreateMemoryInstance
 PluginManager::GetObjectFileCreateMemoryCallbackForPluginName (const ConstString &name)
 {
@@ -1348,7 +1299,7 @@ PluginManager::GetObjectFileCreateMemory
                 return pos->create_memory_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 Error
@@ -1375,8 +1326,8 @@ struct ObjectContainerInstance
     ObjectContainerInstance() :
         name(),
         description(),
-        create_callback (NULL),
-        get_module_specifications (NULL)
+        create_callback(nullptr),
+        get_module_specifications(nullptr)
     {
     }
 
@@ -1384,7 +1335,6 @@ struct ObjectContainerInstance
     std::string description;
     ObjectContainerCreateInstance create_callback;
     ObjectFileGetModuleSpecifications get_module_specifications;
-
 };
 
 typedef std::vector<ObjectContainerInstance> ObjectContainerInstances;
@@ -1452,7 +1402,7 @@ PluginManager::GetObjectContainerCreateC
     ObjectContainerInstances &instances = GetObjectContainerInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 ObjectContainerCreateInstance
@@ -1470,7 +1420,7 @@ PluginManager::GetObjectContainerCreateC
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 ObjectFileGetModuleSpecifications
@@ -1480,7 +1430,7 @@ PluginManager::GetObjectContainerGetModu
     ObjectContainerInstances &instances = GetObjectContainerInstances ();
     if (idx < instances.size())
         return instances[idx].get_module_specifications;
-    return NULL;
+    return nullptr;
 }
 
 #pragma mark LogChannel
@@ -1490,7 +1440,7 @@ struct LogInstance
     LogInstance() :
         name(),
         description(),
-        create_callback(NULL)
+        create_callback(nullptr)
     {
     }
 
@@ -1515,15 +1465,10 @@ GetLogInstances ()
     return g_instances;
 }
 
-
-
 bool
-PluginManager::RegisterPlugin
-(
-    const ConstString &name,
-    const char *description,
-    LogChannelCreateInstance create_callback
-)
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              LogChannelCreateInstance create_callback)
 {
     if (create_callback)
     {
@@ -1567,10 +1512,9 @@ PluginManager::GetLogChannelCreateNameAt
     LogInstances &instances = GetLogInstances ();
     if (idx < instances.size())
         return instances[idx].name.GetCString();
-    return NULL;
+    return nullptr;
 }
 
-
 LogChannelCreateInstance
 PluginManager::GetLogChannelCreateCallbackAtIndex (uint32_t idx)
 {
@@ -1578,7 +1522,7 @@ PluginManager::GetLogChannelCreateCallba
     LogInstances &instances = GetLogInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 LogChannelCreateInstance
@@ -1596,7 +1540,7 @@ PluginManager::GetLogChannelCreateCallba
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 #pragma mark Platform
@@ -1606,8 +1550,8 @@ struct PlatformInstance
     PlatformInstance() :
         name(),
         description(),
-        create_callback(NULL),
-        debugger_init_callback (NULL)
+        create_callback(nullptr),
+        debugger_init_callback(nullptr)
     {
     }
     
@@ -1633,7 +1577,6 @@ GetPlatformInstances ()
     return g_platform_instances;
 }
 
-
 bool
 PluginManager::RegisterPlugin (const ConstString &name,
                                const char *description,
@@ -1657,7 +1600,6 @@ PluginManager::RegisterPlugin (const Con
     return false;
 }
 
-
 const char *
 PluginManager::GetPlatformPluginNameAtIndex (uint32_t idx)
 {
@@ -1665,7 +1607,7 @@ PluginManager::GetPlatformPluginNameAtIn
     PlatformInstances &instances = GetPlatformInstances ();
     if (idx < instances.size())
         return instances[idx].name.GetCString();
-    return NULL;
+    return nullptr;
 }
 
 const char *
@@ -1675,7 +1617,7 @@ PluginManager::GetPlatformPluginDescript
     PlatformInstances &instances = GetPlatformInstances ();
     if (idx < instances.size())
         return instances[idx].description.c_str();
-    return NULL;
+    return nullptr;
 }
 
 bool
@@ -1706,7 +1648,7 @@ PluginManager::GetPlatformCreateCallback
     PlatformInstances &instances = GetPlatformInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 PlatformCreateInstance
@@ -1724,7 +1666,7 @@ PluginManager::GetPlatformCreateCallback
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 size_t
@@ -1746,6 +1688,7 @@ PluginManager::AutoCompletePlatformName
     }
     return matches.GetSize();
 }
+
 #pragma mark Process
 
 struct ProcessInstance
@@ -1753,8 +1696,8 @@ struct ProcessInstance
     ProcessInstance() :
         name(),
         description(),
-        create_callback(NULL),
-        debugger_init_callback(NULL)
+        create_callback(nullptr),
+        debugger_init_callback(nullptr)
     {
     }
     
@@ -1780,7 +1723,6 @@ GetProcessInstances ()
     return g_instances;
 }
 
-
 bool
 PluginManager::RegisterPlugin (const ConstString &name,
                                const char *description,
@@ -1809,7 +1751,7 @@ PluginManager::GetProcessPluginNameAtInd
     ProcessInstances &instances = GetProcessInstances ();
     if (idx < instances.size())
         return instances[idx].name.GetCString();
-    return NULL;
+    return nullptr;
 }
 
 const char *
@@ -1819,7 +1761,7 @@ PluginManager::GetProcessPluginDescripti
     ProcessInstances &instances = GetProcessInstances ();
     if (idx < instances.size())
         return instances[idx].description.c_str();
-    return NULL;
+    return nullptr;
 }
 
 bool
@@ -1850,10 +1792,9 @@ PluginManager::GetProcessCreateCallbackA
     ProcessInstances &instances = GetProcessInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
-
 ProcessCreateInstance
 PluginManager::GetProcessCreateCallbackForPluginName (const ConstString &name)
 {
@@ -1869,7 +1810,7 @@ PluginManager::GetProcessCreateCallbackF
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 #pragma mark ScriptInterpreter
@@ -1880,7 +1821,7 @@ struct ScriptInterpreterInstance
         : name()
         , language(lldb::eScriptLanguageNone)
         , description()
-        , create_callback(NULL)
+        , create_callback(nullptr)
     {
     }
 
@@ -2010,15 +1951,11 @@ GetSymbolFileInstances ()
     return g_instances;
 }
 
-
 bool
-PluginManager::RegisterPlugin
-(
-    const ConstString &name,
-    const char *description,
-    SymbolFileCreateInstance create_callback,
-    DebuggerInitializeCallback debugger_init_callback
-)
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              SymbolFileCreateInstance create_callback,
+                              DebuggerInitializeCallback debugger_init_callback)
 {
     if (create_callback)
     {
@@ -2063,7 +2000,7 @@ PluginManager::GetSymbolFileCreateCallba
     SymbolFileInstances &instances = GetSymbolFileInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 SymbolFileCreateInstance
@@ -2081,11 +2018,9 @@ PluginManager::GetSymbolFileCreateCallba
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
-
-
 #pragma mark SymbolVendor
 
 struct SymbolVendorInstance
@@ -2093,7 +2028,7 @@ struct SymbolVendorInstance
     SymbolVendorInstance() :
         name(),
         description(),
-        create_callback(NULL)
+        create_callback(nullptr)
     {
     }
 
@@ -2119,12 +2054,9 @@ GetSymbolVendorInstances ()
 }
 
 bool
-PluginManager::RegisterPlugin
-(
-    const ConstString &name,
-    const char *description,
-    SymbolVendorCreateInstance create_callback
-)
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              SymbolVendorCreateInstance create_callback)
 {
     if (create_callback)
     {
@@ -2168,10 +2100,9 @@ PluginManager::GetSymbolVendorCreateCall
     SymbolVendorInstances &instances = GetSymbolVendorInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
-
 SymbolVendorCreateInstance
 PluginManager::GetSymbolVendorCreateCallbackForPluginName (const ConstString &name)
 {
@@ -2187,10 +2118,9 @@ PluginManager::GetSymbolVendorCreateCall
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
-
 #pragma mark UnwindAssembly
 
 struct UnwindAssemblyInstance
@@ -2198,7 +2128,7 @@ struct UnwindAssemblyInstance
     UnwindAssemblyInstance() :
         name(),
         description(),
-        create_callback(NULL)
+        create_callback(nullptr)
     {
     }
 
@@ -2224,12 +2154,9 @@ GetUnwindAssemblyInstances ()
 }
 
 bool
-PluginManager::RegisterPlugin
-(
-    const ConstString &name,
-    const char *description,
-    UnwindAssemblyCreateInstance create_callback
-)
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              UnwindAssemblyCreateInstance create_callback)
 {
     if (create_callback)
     {
@@ -2273,10 +2200,9 @@ PluginManager::GetUnwindAssemblyCreateCa
     UnwindAssemblyInstances &instances = GetUnwindAssemblyInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
-
 UnwindAssemblyCreateInstance
 PluginManager::GetUnwindAssemblyCreateCallbackForPluginName (const ConstString &name)
 {
@@ -2292,7 +2218,7 @@ PluginManager::GetUnwindAssemblyCreateCa
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 #pragma mark MemoryHistory
@@ -2300,9 +2226,9 @@ PluginManager::GetUnwindAssemblyCreateCa
 struct MemoryHistoryInstance
 {
     MemoryHistoryInstance() :
-    name(),
-    description(),
-    create_callback(NULL)
+        name(),
+        description(),
+        create_callback(nullptr)
     {
     }
     
@@ -2328,12 +2254,9 @@ GetMemoryHistoryInstances ()
 }
 
 bool
-PluginManager::RegisterPlugin
-(
- const ConstString &name,
- const char *description,
- MemoryHistoryCreateInstance create_callback
- )
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              MemoryHistoryCreateInstance create_callback)
 {
     if (create_callback)
     {
@@ -2377,10 +2300,9 @@ PluginManager::GetMemoryHistoryCreateCal
     MemoryHistoryInstances &instances = GetMemoryHistoryInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
-
 MemoryHistoryCreateInstance
 PluginManager::GetMemoryHistoryCreateCallbackForPluginName (const ConstString &name)
 {
@@ -2396,7 +2318,7 @@ PluginManager::GetMemoryHistoryCreateCal
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 #pragma mark InstrumentationRuntime
@@ -2404,9 +2326,9 @@ PluginManager::GetMemoryHistoryCreateCal
 struct InstrumentationRuntimeInstance
 {
     InstrumentationRuntimeInstance() :
-    name(),
-    description(),
-    create_callback(NULL)
+        name(),
+        description(),
+        create_callback(nullptr)
     {
     }
     
@@ -2433,13 +2355,10 @@ GetInstrumentationRuntimeInstances ()
 }
 
 bool
-PluginManager::RegisterPlugin
-(
- const ConstString &name,
- const char *description,
- InstrumentationRuntimeCreateInstance create_callback,
- InstrumentationRuntimeGetType get_type_callback
- )
+PluginManager::RegisterPlugin(const ConstString &name,
+                              const char *description,
+                              InstrumentationRuntimeCreateInstance create_callback,
+                              InstrumentationRuntimeGetType get_type_callback)
 {
     if (create_callback)
     {
@@ -2484,7 +2403,7 @@ PluginManager::GetInstrumentationRuntime
     InstrumentationRuntimeInstances &instances = GetInstrumentationRuntimeInstances ();
     if (idx < instances.size())
         return instances[idx].get_type_callback;
-    return NULL;
+    return nullptr;
 }
 
 InstrumentationRuntimeCreateInstance
@@ -2494,10 +2413,9 @@ PluginManager::GetInstrumentationRuntime
     InstrumentationRuntimeInstances &instances = GetInstrumentationRuntimeInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
-
 InstrumentationRuntimeCreateInstance
 PluginManager::GetInstrumentationRuntimeCreateCallbackForPluginName (const ConstString &name)
 {
@@ -2513,18 +2431,17 @@ PluginManager::GetInstrumentationRuntime
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 #pragma mark TypeSystem
 
-
 struct TypeSystemInstance
 {
     TypeSystemInstance() :
-    name(),
-    description(),
-    create_callback(NULL)
+        name(),
+        description(),
+        create_callback(nullptr)
     {
     }
 
@@ -2599,7 +2516,7 @@ PluginManager::GetTypeSystemCreateCallba
     TypeSystemInstances &instances = GetTypeSystemInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 TypeSystemCreateInstance
@@ -2617,7 +2534,7 @@ PluginManager::GetTypeSystemCreateCallba
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 TypeSystemEnumerateSupportedLanguages
@@ -2627,7 +2544,7 @@ PluginManager::GetTypeSystemEnumerateSup
     TypeSystemInstances &instances = GetTypeSystemInstances ();
     if (idx < instances.size())
         return instances[idx].enumerate_callback;
-    return NULL;
+    return nullptr;
 }
 
 TypeSystemEnumerateSupportedLanguages
@@ -2645,7 +2562,7 @@ PluginManager::GetTypeSystemEnumerateSup
                 return pos->enumerate_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 #pragma mark REPL
@@ -2653,9 +2570,9 @@ PluginManager::GetTypeSystemEnumerateSup
 struct REPLInstance
 {
     REPLInstance() :
-    name(),
-    description(),
-    create_callback(NULL)
+        name(),
+        description(),
+        create_callback(nullptr)
     {
     }
     
@@ -2730,7 +2647,7 @@ PluginManager::GetREPLCreateCallbackAtIn
     REPLInstances &instances = GetREPLInstances ();
     if (idx < instances.size())
         return instances[idx].create_callback;
-    return NULL;
+    return nullptr;
 }
 
 REPLCreateInstance
@@ -2748,7 +2665,7 @@ PluginManager::GetREPLCreateCallbackForP
                 return pos->create_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 REPLEnumerateSupportedLanguages
@@ -2758,10 +2675,9 @@ PluginManager::GetREPLEnumerateSupported
     REPLInstances &instances = GetREPLInstances ();
     if (idx < instances.size())
         return instances[idx].enumerate_languages_callback;
-    return NULL;
+    return nullptr;
 }
 
-
 REPLEnumerateSupportedLanguages
 PluginManager::GetREPLSystemEnumerateSupportedLanguagesCallbackForPluginName (const ConstString &name)
 {
@@ -2777,7 +2693,7 @@ PluginManager::GetREPLSystemEnumerateSup
                 return pos->enumerate_languages_callback;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 #pragma mark PluginManager
@@ -2871,7 +2787,7 @@ GetDebuggerPropertyForPlugins (Debugger
     {
         static ConstString g_property_name("plugin");
         
-        OptionValuePropertiesSP plugin_properties_sp = parent_properties_sp->GetSubProperty (NULL, g_property_name);
+        OptionValuePropertiesSP plugin_properties_sp = parent_properties_sp->GetSubProperty(nullptr, g_property_name);
         if (!plugin_properties_sp && can_create)
         {
             plugin_properties_sp.reset (new OptionValueProperties (g_property_name));
@@ -2883,7 +2799,7 @@ GetDebuggerPropertyForPlugins (Debugger
         
         if (plugin_properties_sp)
         {
-            lldb::OptionValuePropertiesSP plugin_type_properties_sp = plugin_properties_sp->GetSubProperty (NULL, plugin_type_name);
+            lldb::OptionValuePropertiesSP plugin_type_properties_sp = plugin_properties_sp->GetSubProperty(nullptr, plugin_type_name);
             if (!plugin_type_properties_sp && can_create)
             {
                 plugin_type_properties_sp.reset (new OptionValueProperties (plugin_type_name));
@@ -2911,7 +2827,7 @@ GetDebuggerPropertyForPluginsOldStyle (D
     lldb::OptionValuePropertiesSP parent_properties_sp (debugger.GetValueProperties());
     if (parent_properties_sp)
     {
-        OptionValuePropertiesSP plugin_properties_sp = parent_properties_sp->GetSubProperty (NULL, plugin_type_name);
+        OptionValuePropertiesSP plugin_properties_sp = parent_properties_sp->GetSubProperty(nullptr, plugin_type_name);
         if (!plugin_properties_sp && can_create)
         {
             plugin_properties_sp.reset (new OptionValueProperties (plugin_type_name));
@@ -2923,7 +2839,7 @@ GetDebuggerPropertyForPluginsOldStyle (D
         
         if (plugin_properties_sp)
         {
-            lldb::OptionValuePropertiesSP plugin_type_properties_sp = plugin_properties_sp->GetSubProperty (NULL, g_property_name);
+            lldb::OptionValuePropertiesSP plugin_type_properties_sp = plugin_properties_sp->GetSubProperty(nullptr, g_property_name);
             if (!plugin_type_properties_sp && can_create)
             {
                 plugin_type_properties_sp.reset (new OptionValueProperties (g_property_name));
@@ -2990,7 +2906,7 @@ const char* kProcessPluginName("process"
 const char* kSymbolFilePluginName("symbol-file");
 const char* kJITLoaderPluginName("jit-loader");
 
-}
+} // anonymous namespace
 
 lldb::OptionValuePropertiesSP
 PluginManager::GetSettingForDynamicLoaderPlugin (Debugger &debugger,
@@ -3013,7 +2929,6 @@ PluginManager::CreateSettingForDynamicLo
                                   is_global_property);
 }
 
-
 lldb::OptionValuePropertiesSP
 PluginManager::GetSettingForPlatformPlugin (Debugger &debugger, const ConstString &setting_name)
 {
@@ -3038,7 +2953,6 @@ PluginManager::CreateSettingForPlatformP
                                   GetDebuggerPropertyForPluginsOldStyle);
 }
 
-
 lldb::OptionValuePropertiesSP
 PluginManager::GetSettingForProcessPlugin (Debugger &debugger, const ConstString &setting_name)
 {




More information about the lldb-commits mailing list