diff options
author | Zachary Turner <zturner@google.com> | 2016-11-16 21:45:04 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-11-16 21:45:04 +0000 |
commit | 067d1db139b6f9d32f8cce8f5af8319613d523c1 (patch) | |
tree | 59853a98fcc5e79e8db7602011a19cfb08f32ec3 | |
parent | 7a74803abf1423854792987492fe25e975bae9f8 (diff) | |
download | bcm5719-llvm-067d1db139b6f9d32f8cce8f5af8319613d523c1.tar.gz bcm5719-llvm-067d1db139b6f9d32f8cce8f5af8319613d523c1.zip |
Make Apropos functions accept StringRefs.
llvm-svn: 287157
6 files changed, 12 insertions, 14 deletions
diff --git a/lldb/include/lldb/Core/UserSettingsController.h b/lldb/include/lldb/Core/UserSettingsController.h index d593fea7996..30fe0d5f5eb 100644 --- a/lldb/include/lldb/Core/UserSettingsController.h +++ b/lldb/include/lldb/Core/UserSettingsController.h @@ -1,5 +1,4 @@ -//====-- UserSettingsController.h --------------------------------*- C++ -//-*-===// +//====-- UserSettingsController.h --------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // @@ -63,7 +62,7 @@ public: virtual void DumpAllDescriptions(CommandInterpreter &interpreter, Stream &strm) const; - size_t Apropos(const char *keyword, + size_t Apropos(llvm::StringRef keyword, std::vector<const Property *> &matching_properties) const; lldb::OptionValuePropertiesSP GetSubProperty(const ExecutionContext *exe_ctx, diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h index cad6fbb136c..2c455e31c79 100644 --- a/lldb/include/lldb/Interpreter/CommandInterpreter.h +++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h @@ -407,7 +407,7 @@ public: bool GetSynchronous(); - void FindCommandsForApropos(const char *word, StringList &commands_found, + void FindCommandsForApropos(llvm::StringRef word, StringList &commands_found, StringList &commands_help, bool search_builtin_commands, bool search_user_commands, @@ -517,7 +517,7 @@ private: CommandObject *ResolveCommandImpl(std::string &command_line, CommandReturnObject &result); - void FindCommandsForApropos(const char *word, StringList &commands_found, + void FindCommandsForApropos(llvm::StringRef word, StringList &commands_found, StringList &commands_help, CommandObject::CommandMap &command_map); diff --git a/lldb/include/lldb/Interpreter/OptionValueProperties.h b/lldb/include/lldb/Interpreter/OptionValueProperties.h index a32b51665b6..d683348c531 100644 --- a/lldb/include/lldb/Interpreter/OptionValueProperties.h +++ b/lldb/include/lldb/Interpreter/OptionValueProperties.h @@ -62,7 +62,7 @@ public: virtual void DumpAllDescriptions(CommandInterpreter &interpreter, Stream &strm) const; - void Apropos(const char *keyword, + void Apropos(llvm::StringRef keyword, std::vector<const Property *> &matching_properties) const; void Initialize(const PropertyDefinition *setting_definitions); diff --git a/lldb/source/Core/UserSettingsController.cpp b/lldb/source/Core/UserSettingsController.cpp index 0910f400296..00fbc4b8a9b 100644 --- a/lldb/source/Core/UserSettingsController.cpp +++ b/lldb/source/Core/UserSettingsController.cpp @@ -73,7 +73,7 @@ Error Properties::DumpPropertyValue(const ExecutionContext *exe_ctx, } size_t -Properties::Apropos(const char *keyword, +Properties::Apropos(llvm::StringRef keyword, std::vector<const Property *> &matching_properties) const { OptionValuePropertiesSP properties_sp(GetValueProperties()); if (properties_sp) { diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 2047d4a4433..320214df233 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -2596,19 +2596,19 @@ void CommandInterpreter::OutputHelpText(Stream &strm, llvm::StringRef word_text, } void CommandInterpreter::FindCommandsForApropos( - const char *search_word, StringList &commands_found, + llvm::StringRef search_word, StringList &commands_found, StringList &commands_help, CommandObject::CommandMap &command_map) { CommandObject::CommandMap::const_iterator pos; for (pos = command_map.begin(); pos != command_map.end(); ++pos) { - const char *command_name = pos->first.c_str(); + llvm::StringRef command_name = pos->first; CommandObject *cmd_obj = pos->second.get(); const bool search_short_help = true; const bool search_long_help = false; const bool search_syntax = false; const bool search_options = false; - if (strcasestr(command_name, search_word) || + if (command_name.contains_lower(search_word) || cmd_obj->HelpTextContainsWord(search_word, search_short_help, search_long_help, search_syntax, search_options)) { @@ -2624,7 +2624,7 @@ void CommandInterpreter::FindCommandsForApropos( } } -void CommandInterpreter::FindCommandsForApropos(const char *search_word, +void CommandInterpreter::FindCommandsForApropos(llvm::StringRef search_word, StringList &commands_found, StringList &commands_help, bool search_builtin_commands, diff --git a/lldb/source/Interpreter/OptionValueProperties.cpp b/lldb/source/Interpreter/OptionValueProperties.cpp index f54bbfeb0b5..f6a96f54631 100644 --- a/lldb/source/Interpreter/OptionValueProperties.cpp +++ b/lldb/source/Interpreter/OptionValueProperties.cpp @@ -1,5 +1,4 @@ -//===-- OptionValueProperties.cpp ---------------------------------*- C++ -//-*-===// +//===-- OptionValueProperties.cpp --------------------------------*- C++-*-===// // // The LLVM Compiler Infrastructure // @@ -635,7 +634,7 @@ void OptionValueProperties::DumpAllDescriptions(CommandInterpreter &interpreter, } void OptionValueProperties::Apropos( - const char *keyword, + llvm::StringRef keyword, std::vector<const Property *> &matching_properties) const { const size_t num_properties = m_properties.size(); StreamString strm; |