Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes.

llvm-svn: 261389
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp
index ed70551..6d35c9c 100644
--- a/lldb/source/Commands/CommandObjectMultiword.cpp
+++ b/lldb/source/Commands/CommandObjectMultiword.cpp
@@ -7,11 +7,11 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Interpreter/CommandObjectMultiword.h"
 // C Includes
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
+#include "lldb/Interpreter/CommandObjectMultiword.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/Options.h"
@@ -24,22 +24,17 @@
 // CommandObjectMultiword
 //-------------------------------------------------------------------------
 
-CommandObjectMultiword::CommandObjectMultiword
-(
-    CommandInterpreter &interpreter,
-    const char *name,
-    const char *help,
-    const char *syntax,
-    uint32_t flags
-) :
+CommandObjectMultiword::CommandObjectMultiword(CommandInterpreter &interpreter,
+                                               const char *name,
+                                               const char *help,
+                                               const char *syntax,
+                                               uint32_t flags) :
     CommandObject (interpreter, name, help, syntax, flags),
     m_can_be_removed(false)
 {
 }
 
-CommandObjectMultiword::~CommandObjectMultiword ()
-{
-}
+CommandObjectMultiword::~CommandObjectMultiword() = default;
 
 CommandObjectSP
 CommandObjectMultiword::GetSubcommandSP (const char *sub_cmd, StringList *matches)
@@ -58,9 +53,8 @@
         }
         else
         {
-
             StringList local_matches;
-            if (matches == NULL)
+            if (matches == nullptr)
                 matches = &local_matches;
             int num_matches = CommandObject::AddNamesMatchingPartialString (m_subcommand_dict, sub_cmd, *matches);
 
@@ -86,13 +80,10 @@
 }
 
 bool
-CommandObjectMultiword::LoadSubCommand 
-(
-    const char *name,
-    const CommandObjectSP& cmd_obj
-)
+CommandObjectMultiword::LoadSubCommand(const char *name,
+                                       const CommandObjectSP& cmd_obj)
 {
-    if (cmd_obj.get())
+    if (cmd_obj)
         assert((&GetCommandInterpreter() == &cmd_obj->GetCommandInterpreter()) && "tried to add a CommandObject from a different interpreter");
     
     CommandMap::iterator pos;
@@ -132,7 +123,7 @@
             {
                 StringList matches;
                 CommandObject *sub_cmd_obj = GetSubcommandObject(sub_command, &matches);
-                if (sub_cmd_obj != NULL)
+                if (sub_cmd_obj != nullptr)
                 {
                     // Now call CommandObject::Execute to process and options in 'rest_of_line'.  From there
                     // the command-specific version of Execute will be called, with the processed arguments.
@@ -221,16 +212,13 @@
 }
 
 int
-CommandObjectMultiword::HandleCompletion
-(
-    Args &input,
-    int &cursor_index,
-    int &cursor_char_position,
-    int match_start_point,
-    int max_return_elements,
-    bool &word_complete,
-    StringList &matches
-)
+CommandObjectMultiword::HandleCompletion(Args &input,
+                                         int &cursor_index,
+                                         int &cursor_char_position,
+                                         int match_start_point,
+                                         int max_return_elements,
+                                         bool &word_complete,
+                                         StringList &matches)
 {
     // Any of the command matches will provide a complete word, otherwise the individual
     // completers will override this.
@@ -244,13 +232,13 @@
                                                       matches);
 
         if (matches.GetSize() == 1
-            && matches.GetStringAtIndex(0) != NULL
+            && matches.GetStringAtIndex(0) != nullptr
             && strcmp (arg0, matches.GetStringAtIndex(0)) == 0)
         {
             StringList temp_matches;
             CommandObject *cmd_obj = GetSubcommandObject (arg0,
                                                           &temp_matches);
-            if (cmd_obj != NULL)
+            if (cmd_obj != nullptr)
             {
                 if (input.GetArgumentCount() == 1)
                 {
@@ -278,7 +266,7 @@
     {
         CommandObject *sub_command_object = GetSubcommandObject (arg0,
                                                                  &matches);
-        if (sub_command_object == NULL)
+        if (sub_command_object == nullptr)
         {
             return matches.GetSize();
         }
@@ -296,7 +284,6 @@
                                                          word_complete,
                                                          matches);
         }
-
     }
 }
 
@@ -305,14 +292,13 @@
 {
     index++;
     if (current_command_args.GetArgumentCount() <= index)
-        return NULL;
+        return nullptr;
     CommandObject *sub_command_object = GetSubcommandObject (current_command_args.GetArgumentAtIndex(index));
-    if (sub_command_object == NULL)
-        return NULL;
+    if (sub_command_object == nullptr)
+        return nullptr;
     return sub_command_object->GetRepeatCommand(current_command_args, index);
 }
 
-
 void
 CommandObjectMultiword::AproposAllSubCommands (const char *prefix,
                                                const char *search_word,
@@ -343,8 +329,6 @@
     }
 }
 
-
-
 CommandObjectProxy::CommandObjectProxy (CommandInterpreter &interpreter,
                                         const char *name,
                                         const char *help,
@@ -354,9 +338,7 @@
 {
 }
 
-CommandObjectProxy::~CommandObjectProxy ()
-{
-}
+CommandObjectProxy::~CommandObjectProxy() = default;
 
 const char *
 CommandObjectProxy::GetHelpLong ()
@@ -364,7 +346,7 @@
     CommandObject *proxy_command = GetProxyCommandObject();
     if (proxy_command)
         return proxy_command->GetHelpLong();
-    return NULL;
+    return nullptr;
 }
 
 bool
@@ -408,7 +390,7 @@
     CommandObject *proxy_command = GetProxyCommandObject();
     if (proxy_command)
         return proxy_command->GetSubcommandObject(sub_cmd, matches);
-    return NULL;
+    return nullptr;
 }
 
 void
@@ -453,17 +435,15 @@
     return false;
 }
 
-
 Options *
 CommandObjectProxy::GetOptions ()
 {
     CommandObject *proxy_command = GetProxyCommandObject();
     if (proxy_command)
         return proxy_command->GetOptions ();
-    return NULL;
+    return nullptr;
 }
 
-
 int
 CommandObjectProxy::HandleCompletion (Args &input,
                                       int &cursor_index,
@@ -485,6 +465,7 @@
     matches.Clear();
     return 0;
 }
+
 int
 CommandObjectProxy::HandleArgumentCompletion (Args &input,
                                               int &cursor_index,
@@ -516,7 +497,7 @@
     CommandObject *proxy_command = GetProxyCommandObject();
     if (proxy_command)
         return proxy_command->GetRepeatCommand (current_command_args, index);
-    return NULL;
+    return nullptr;
 }
 
 bool
@@ -530,5 +511,3 @@
     result.SetStatus (eReturnStatusFailed);
     return false;
 }
-
-