Change some more CommandObject functions to StringRef.

llvm-svn: 286742
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp
index 249863b..bcc0229 100644
--- a/lldb/source/Commands/CommandObjectMultiword.cpp
+++ b/lldb/source/Commands/CommandObjectMultiword.cpp
@@ -34,7 +34,7 @@
 
 CommandObjectMultiword::~CommandObjectMultiword() = default;
 
-CommandObjectSP CommandObjectMultiword::GetSubcommandSP(const char *sub_cmd,
+CommandObjectSP CommandObjectMultiword::GetSubcommandSP(llvm::StringRef sub_cmd,
                                                         StringList *matches) {
   CommandObjectSP return_cmd_sp;
   CommandObject::CommandMap::iterator pos;
@@ -69,12 +69,12 @@
 }
 
 CommandObject *
-CommandObjectMultiword::GetSubcommandObject(const char *sub_cmd,
+CommandObjectMultiword::GetSubcommandObject(llvm::StringRef sub_cmd,
                                             StringList *matches) {
   return GetSubcommandSP(sub_cmd, matches).get();
 }
 
-bool CommandObjectMultiword::LoadSubCommand(const char *name,
+bool CommandObjectMultiword::LoadSubCommand(llvm::StringRef name,
                                             const CommandObjectSP &cmd_obj) {
   if (cmd_obj)
     assert((&GetCommandInterpreter() == &cmd_obj->GetCommandInterpreter()) &&
@@ -246,8 +246,8 @@
   return sub_command_object->GetRepeatCommand(current_command_args, index);
 }
 
-void CommandObjectMultiword::AproposAllSubCommands(const char *prefix,
-                                                   const char *search_word,
+void CommandObjectMultiword::AproposAllSubCommands(llvm::StringRef prefix,
+                                                   llvm::StringRef search_word,
                                                    StringList &commands_found,
                                                    StringList &commands_help) {
   CommandObject::CommandMap::const_iterator pos;
@@ -265,7 +265,7 @@
     }
 
     if (sub_cmd_obj->IsMultiwordObject())
-      sub_cmd_obj->AproposAllSubCommands(complete_command_name.GetData(),
+      sub_cmd_obj->AproposAllSubCommands(complete_command_name.GetString(),
                                          search_word, commands_found,
                                          commands_help);
   }
@@ -313,15 +313,16 @@
     return proxy_command->GenerateHelpText(result);
 }
 
-lldb::CommandObjectSP CommandObjectProxy::GetSubcommandSP(const char *sub_cmd,
-                                                          StringList *matches) {
+lldb::CommandObjectSP
+CommandObjectProxy::GetSubcommandSP(llvm::StringRef sub_cmd,
+                                    StringList *matches) {
   CommandObject *proxy_command = GetProxyCommandObject();
   if (proxy_command)
     return proxy_command->GetSubcommandSP(sub_cmd, matches);
   return lldb::CommandObjectSP();
 }
 
-CommandObject *CommandObjectProxy::GetSubcommandObject(const char *sub_cmd,
+CommandObject *CommandObjectProxy::GetSubcommandObject(llvm::StringRef sub_cmd,
                                                        StringList *matches) {
   CommandObject *proxy_command = GetProxyCommandObject();
   if (proxy_command)
@@ -329,8 +330,8 @@
   return nullptr;
 }
 
-void CommandObjectProxy::AproposAllSubCommands(const char *prefix,
-                                               const char *search_word,
+void CommandObjectProxy::AproposAllSubCommands(llvm::StringRef prefix,
+                                               llvm::StringRef search_word,
                                                StringList &commands_found,
                                                StringList &commands_help) {
   CommandObject *proxy_command = GetProxyCommandObject();
@@ -340,7 +341,7 @@
 }
 
 bool CommandObjectProxy::LoadSubCommand(
-    const char *cmd_name, const lldb::CommandObjectSP &command_sp) {
+    llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_sp) {
   CommandObject *proxy_command = GetProxyCommandObject();
   if (proxy_command)
     return proxy_command->LoadSubCommand(cmd_name, command_sp);
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp
index e71c109..c9337a5 100644
--- a/lldb/source/Interpreter/CommandObject.cpp
+++ b/lldb/source/Interpreter/CommandObject.cpp
@@ -316,7 +316,7 @@
   }
 }
 
-bool CommandObject::HelpTextContainsWord(const char *search_word,
+bool CommandObject::HelpTextContainsWord(llvm::StringRef search_word,
                                          bool search_short_help,
                                          bool search_long_help,
                                          bool search_syntax,
@@ -341,9 +341,9 @@
     GetOptions()->GenerateOptionUsage(
         usage_help, this,
         GetCommandInterpreter().GetDebugger().GetTerminalWidth());
-    if (usage_help.GetSize() > 0) {
-      const char *usage_text = usage_help.GetData();
-      if (strcasestr(usage_text, search_word))
+    if (!usage_help.Empty()) {
+      llvm::StringRef usage_text = usage_help.GetString();
+      if (usage_text.contains_lower(search_word))
         found_word = true;
     }
   }