From e50f9c419a84d1e58c38aa660c445395ad8056e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 24 Jun 2021 11:06:42 +0300 Subject: [lldb] Rename StringRef _lower() method calls to _insensitive() --- lldb/source/Interpreter/CommandInterpreter.cpp | 2 +- lldb/source/Interpreter/CommandObject.cpp | 8 ++++---- lldb/source/Interpreter/OptionArgParser.cpp | 16 ++++++++-------- lldb/source/Interpreter/OptionValueProperties.cpp | 4 ++-- lldb/source/Interpreter/ScriptInterpreter.cpp | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) (limited to 'lldb/source/Interpreter') diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 8a3a409..2e07ff5 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -2675,7 +2675,7 @@ void CommandInterpreter::FindCommandsForApropos( const bool search_long_help = false; const bool search_syntax = false; const bool search_options = false; - if (command_name.contains_lower(search_word) || + if (command_name.contains_insensitive(search_word) || cmd_obj->HelpTextContainsWord(search_word, search_short_help, search_long_help, search_syntax, search_options)) { diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index 5fa8468..a7dcd56 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -316,11 +316,11 @@ bool CommandObject::HelpTextContainsWord(llvm::StringRef search_word, llvm::StringRef long_help = GetHelpLong(); llvm::StringRef syntax_help = GetSyntax(); - if (search_short_help && short_help.contains_lower(search_word)) + if (search_short_help && short_help.contains_insensitive(search_word)) found_word = true; - else if (search_long_help && long_help.contains_lower(search_word)) + else if (search_long_help && long_help.contains_insensitive(search_word)) found_word = true; - else if (search_syntax && syntax_help.contains_lower(search_word)) + else if (search_syntax && syntax_help.contains_insensitive(search_word)) found_word = true; if (!found_word && search_options && GetOptions() != nullptr) { @@ -330,7 +330,7 @@ bool CommandObject::HelpTextContainsWord(llvm::StringRef search_word, GetCommandInterpreter().GetDebugger().GetTerminalWidth()); if (!usage_help.Empty()) { llvm::StringRef usage_text = usage_help.GetString(); - if (usage_text.contains_lower(search_word)) + if (usage_text.contains_insensitive(search_word)) found_word = true; } } diff --git a/lldb/source/Interpreter/OptionArgParser.cpp b/lldb/source/Interpreter/OptionArgParser.cpp index 3dcb30e8..93b01ab 100644 --- a/lldb/source/Interpreter/OptionArgParser.cpp +++ b/lldb/source/Interpreter/OptionArgParser.cpp @@ -20,11 +20,11 @@ bool OptionArgParser::ToBoolean(llvm::StringRef ref, bool fail_value, if (success_ptr) *success_ptr = true; ref = ref.trim(); - if (ref.equals_lower("false") || ref.equals_lower("off") || - ref.equals_lower("no") || ref.equals_lower("0")) { + if (ref.equals_insensitive("false") || ref.equals_insensitive("off") || + ref.equals_insensitive("no") || ref.equals_insensitive("0")) { return false; - } else if (ref.equals_lower("true") || ref.equals_lower("on") || - ref.equals_lower("yes") || ref.equals_lower("1")) { + } else if (ref.equals_insensitive("true") || ref.equals_insensitive("on") || + ref.equals_insensitive("yes") || ref.equals_insensitive("1")) { return true; } if (success_ptr) @@ -125,13 +125,13 @@ lldb::ScriptLanguage OptionArgParser::ToScriptLanguage( if (success_ptr) *success_ptr = true; - if (s.equals_lower("python")) + if (s.equals_insensitive("python")) return eScriptLanguagePython; - if (s.equals_lower("lua")) + if (s.equals_insensitive("lua")) return eScriptLanguageLua; - if (s.equals_lower("default")) + if (s.equals_insensitive("default")) return eScriptLanguageDefault; - if (s.equals_lower("none")) + if (s.equals_insensitive("none")) return eScriptLanguageNone; if (success_ptr) diff --git a/lldb/source/Interpreter/OptionValueProperties.cpp b/lldb/source/Interpreter/OptionValueProperties.cpp index c1551bd..ae07379 100644 --- a/lldb/source/Interpreter/OptionValueProperties.cpp +++ b/lldb/source/Interpreter/OptionValueProperties.cpp @@ -630,11 +630,11 @@ void OptionValueProperties::Apropos( } else { bool match = false; llvm::StringRef name = property->GetName(); - if (name.contains_lower(keyword)) + if (name.contains_insensitive(keyword)) match = true; else { llvm::StringRef desc = property->GetDescription(); - if (desc.contains_lower(keyword)) + if (desc.contains_insensitive(keyword)) match = true; } if (match) { diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp index 3802f2d..7351143 100644 --- a/lldb/source/Interpreter/ScriptInterpreter.cpp +++ b/lldb/source/Interpreter/ScriptInterpreter.cpp @@ -85,11 +85,11 @@ ScriptInterpreter::GetStatusFromSBError(const lldb::SBError &error) const { lldb::ScriptLanguage ScriptInterpreter::StringToLanguage(const llvm::StringRef &language) { - if (language.equals_lower(LanguageToString(eScriptLanguageNone))) + if (language.equals_insensitive(LanguageToString(eScriptLanguageNone))) return eScriptLanguageNone; - if (language.equals_lower(LanguageToString(eScriptLanguagePython))) + if (language.equals_insensitive(LanguageToString(eScriptLanguagePython))) return eScriptLanguagePython; - if (language.equals_lower(LanguageToString(eScriptLanguageLua))) + if (language.equals_insensitive(LanguageToString(eScriptLanguageLua))) return eScriptLanguageLua; return eScriptLanguageUnknown; } -- cgit v1.1